Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Could someone explain Remote Functions to me?

Asked by 4 years ago

I'm fairly new to scripting and I've just grasped the idea of Remote Events, however I'm rather confused about callbacks and Remote Functions. If anybody could explain like I'm five, that'd be greatly appreciated!

1 answer

Log in to vote
1
Answered by 4 years ago
Edited 4 years ago

RemoteFunctions are usefull in many ways, for example getting information from server

(I personally use it in my games to get RemoteKeys from server)

Here is an example:

Server Script

1local TableWithData = {1,2,3}
2 
3remotefunction.OnServerInvoke = function(CalledBy, ...)
4    return TableWithData
5end)

Local Script

1local Data = remotefunction:InvokeServer() -- Gets TableWithData
2 
3print(unpack(Data)) -- 1,2,3

Note: What I provided is not the best explanation in the world. I would recommend checking it out at https://developer.roblox.com/en-us/api-reference/class/RemoteFunction

Ad

Answer this question