|
| 20 Jun 2016 08:37 PM |
I have read a tutorial on ROBLOX Wiki but it doesn't work, am I doing it wrong?
http://wiki.roblox.com/index.php?title=RemoteFunction_and_RemoteEvent_Tutorial |
|
|
| Report Abuse |
|
|
|
| 20 Jun 2016 08:38 PM |
| If you can explain RemoteFunction too that would be great. |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 20 Jun 2016 08:40 PM |
local re = game.ReplicatedStorage:WaitForChild("RemoteEvent")
re.OnServerEvent:connect(function(plr,msg) --the player will always be the first arg print(msg) re:FireClient(plr,"Hello!") end)
local re = game.ReplicatedStorage:WaitForChild("RemoteEvent")
re:FireServer("Hi!")
re.OnClientEvent:connect(function(msg) print(msg) end)
Output:
Hi! Hello!
|
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 20 Jun 2016 08:42 PM |
the top is a server script and the bottom code is in a local script sorry.
RemoteFunctions operate thesame but are events that yield until there is data that is returned. Remote Events don't yield
|
|
|
| Report Abuse |
|
|
|
| 21 Jun 2016 01:03 PM |
| Okay, thanks. The layout is the same as the wiki says. :D |
|
|
| Report Abuse |
|
|
|
| 21 Jun 2016 01:09 PM |
Wait, the code doesn't work for me. I added a RemoteEvent inside the ReplicatedStorage.
Is there a specific place where the scripts should be? |
|
|
| Report Abuse |
|
|
|
| 21 Jun 2016 01:34 PM |
| Never mind, I had to watch youtube to figure it out. xD (I like reading wikis.) |
|
|
| Report Abuse |
|
|