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

RemoteFunctions and how to use them?

Asked by
hellmatic 1523 Moderation Voter
7 years ago

I am familiar with RemoteEvents and had success with them. However, I am stuck on RemoteFunctions. How do I know when to use them? How do you use them?

0
The only major difference is that the remote function will be awaiting a reply...basically you should always use a remote event unless you intend to have some 2 way communication Vulkarin 581 — 7y

1 answer

Log in to vote
1
Answered by 7 years ago

To use remote functions, all you need to know is the event that fires the function, and the way to fire them.

A remote function is an instance that allows you to transfer requests through server, or client.

Below is an example of how you would call the remote function.

local remotefunction= game.ReplicatedStorage.RemoteFunctionName
remotefunction:InvokeServer(arguments)

When requesting the function to be passed through the server, you must be using a LocalScript, and when requesting the function to be passed through the client, you must be using a Script.

Below is an example of how the function would work;

local remotefunction= game.ReplicatedStorage.RemoteFunctionName

remotefunction.OnServerInvoke = function(arguments)
    print("Cheese")
end

When you call the function through the server, it will print cheese.

The reason these functions are very important on roblox, is because they allow you to transfer data through Filtering Enabled.

Ad

Answer this question