Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Could someone explain Remote Functions to me?

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

✓ Accepted answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.