|
| 10 Aug 2016 06:38 PM |
I want to make the PlayerGui.Sellfish.Main.Visible = true when Touched the part. Visible = false when TouchedEnded. Idk how? Someone told me to use Remotesevents.
|
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 10 Aug 2016 06:56 PM |
b3 I really need it please!
|
|
|
| Report Abuse |
|
|
| |
|
Detabesu
|
  |
| Joined: 22 May 2016 |
| Total Posts: 100 |
|
|
| 10 Aug 2016 07:24 PM |
| client side sir just make the touched even client side |
|
|
| Report Abuse |
|
|
|
| 10 Aug 2016 07:25 PM |
"client side sir just make the touched even client side"
no
Formerly xXTheRobotXx, add 13,349 posts |
|
|
| Report Abuse |
|
|
Detabesu
|
  |
| Joined: 22 May 2016 |
| Total Posts: 100 |
|
|
| 10 Aug 2016 07:26 PM |
What so you should use remotes? Because doing a touched event client side won't work right |
|
|
| Report Abuse |
|
|
i_Movie
|
  |
| Joined: 06 Apr 2014 |
| Total Posts: 11725 |
|
|
| 10 Aug 2016 07:26 PM |
serverscript in part
local RemoteEvent = game:GetService('ReplicatedStorage'):WaitForChild("RemoteEvent")
Part.Touched:connect(function() RemoteEvent:FireClient() end)
Localscript in startergui
local RemoteEvent = game:GetService('ReplicatedStorage'):WaitForChild("RemoteEvent")
RemoteEvent.OnClientEvent:connect(function(plr) print(""..plr.Name.." has fired event") local PlayerGui = plr.PlayerGui PlayerGui.Sellfish.Main.Visible = true end)
I think that's how you do it but... I'm super new with FE so test it. :P
|
|
|
| Report Abuse |
|
|
|
| 10 Aug 2016 07:28 PM |
@i_Movie
1. that will fire every time the part is touched 2. you didn't define a player to call FireClient with
i already gave op a working setup in a pm
Formerly xXTheRobotXx, add 13,349 posts |
|
|
| Report Abuse |
|
|
i_Movie
|
  |
| Joined: 06 Apr 2014 |
| Total Posts: 11725 |
|
|
| 10 Aug 2016 07:29 PM |
@Lord
Oh.. I never know what to put in FireClient().. So I just leave it blank.
|
|
|
| Report Abuse |
|
|
|
| 10 Aug 2016 07:30 PM |
it will throw an error left blank unless you call FireAllClients()
Formerly xXTheRobotXx, add 13,349 posts |
|
|
| Report Abuse |
|
|
i_Movie
|
  |
| Joined: 06 Apr 2014 |
| Total Posts: 11725 |
|
|
| 10 Aug 2016 07:32 PM |
@lord
So.. You would do this?
Part.Touched:connect(function(plr) RemoteEvent:FireClient(game.Players:GetPlayerFromCharacter(plr)) ?? end)
|
|
|
| Report Abuse |
|
|
|
| 10 Aug 2016 07:32 PM |
yes, that's exactly what you would do
but you're still not checking if what touched it is a player
Formerly xXTheRobotXx, add 13,349 posts |
|
|
| Report Abuse |
|
|
i_Movie
|
  |
| Joined: 06 Apr 2014 |
| Total Posts: 11725 |
|
|
| 10 Aug 2016 07:33 PM |
oops.. plr.Parent:GetPlayerFromCharacter(plr) *
|
|
|
| Report Abuse |
|
|
i_Movie
|
  |
| Joined: 06 Apr 2014 |
| Total Posts: 11725 |
|
|
| 10 Aug 2016 07:34 PM |
Ohh.. So this then
part.Touched:connect(function(plr) local Player = plr.Parent if Player ~= nil then RemoteEvent:FireClient(Player) end end)
|
|
|
| Report Abuse |
|
|
i_Movie
|
  |
| Joined: 06 Apr 2014 |
| Total Posts: 11725 |
|
|
| 10 Aug 2016 07:35 PM |
Not sure if that's right, I just guessed.. But at least now I know what to do.
|
|
|
| Report Abuse |
|
|
|
| 10 Aug 2016 07:37 PM |
this is all you have to do
if hit.Parent:findFirstChild("Humanoid") then
Formerly xXTheRobotXx, add 13,349 posts |
|
|
| Report Abuse |
|
|
Detabesu
|
  |
| Joined: 22 May 2016 |
| Total Posts: 100 |
|
|
| 10 Aug 2016 07:39 PM |
| Using remotes for every little thing isn't good practice. |
|
|
| Report Abuse |
|
|
i_Movie
|
  |
| Joined: 06 Apr 2014 |
| Total Posts: 11725 |
|
|
| 10 Aug 2016 07:40 PM |
Oh, I see.
In other words:
Part.Touched:connect(function(Object) if Object.Parent:FindFirstChild('Humanoid') then RemoteEvent:FireClient(Object) -- Would your parameter still be object? Or would it be Object.Parent? end end)
|
|
|
| Report Abuse |
|
|