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

local TableWithData = {1,2,3}

remotefunction.OnServerInvoke = function(CalledBy, ...)
    return TableWithData
end)


Local Script

local Data = remotefunction:InvokeServer() -- Gets TableWithData

print(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