generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: RemotesEvents

Previous Thread :: Next Thread 
UnderworldFPS is not online. UnderworldFPS
Joined: 30 Mar 2016
Total Posts: 706
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
UnderworldFPS is not online. UnderworldFPS
Joined: 30 Mar 2016
Total Posts: 706
10 Aug 2016 06:40 PM
b1


Report Abuse
UnderworldFPS is not online. UnderworldFPS
Joined: 30 Mar 2016
Total Posts: 706
10 Aug 2016 06:41 PM
b2


Report Abuse
UnderworldFPS is not online. UnderworldFPS
Joined: 30 Mar 2016
Total Posts: 706
10 Aug 2016 06:56 PM
b3 I really need it please!


Report Abuse
UnderworldFPS is not online. UnderworldFPS
Joined: 30 Mar 2016
Total Posts: 706
10 Aug 2016 07:03 PM
b4


Report Abuse
Detabesu is not online. 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
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
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 is not online. 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 is not online. 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
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
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 is not online. 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
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
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 is not online. 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
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
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 is not online. i_Movie
Joined: 06 Apr 2014
Total Posts: 11725
10 Aug 2016 07:33 PM
oops.. plr.Parent:GetPlayerFromCharacter(plr) *


Report Abuse
i_Movie is not online. 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 is not online. 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
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
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 is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image