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

What is this line in parentheses do when a remote event is fired?

I'm very confused, I saw this in a script I'm looking in and I want to know what it does and how the remote event script knows what it does. Any clarification would be appreciated, thanks! This is the code by the way.

local Event = Instance.new("RemoteEvent")
Event:FireServer("Potato")

Basically I want to know how "Potato" (or the words put in the parentheses after FireServer) could affect or change the fired event. Thank you all so much!

1 answer

✓ Accepted answer

The parenthesis is used to transfer information from one side of the event to another.

For example:

script 1 (fires the event)

local Event = game.ServerStorage:WaitForChild('RemoteEvent')

Event:FireServer('Hello!')

script 2 (receives the event)

script.Parent.OnServerEvent:Connect(function(text) --the "Hello!" string that we sent over, put into a variable
wait(3)
print(text)
end)

2 comments

1

THIS HELPED ME SO MUCH THANK YOU!

0

You're welcome!

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