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

Can someone walk me through how a remote event works?

Can someone give me a example of a remoteevent? And how it works?

1 answer

✓ Accepted answer

RemoteEvents are used to communicate with the Server/Client For example:

--This is a ServerScript
game.Players.PlayerAdded:Connect(function(plr)
message = "RemoteEvent was fired"-- You can pass data through the event.
game.ReplicatedStorage.RemoteEvent:FireClient(plr, message)--Heres the Data inside the function
--Put RemoteEvents inside RepStorage
end)

Now local part:

--This is a Local Script
game.ReplicatedStorage.RemoteEvent.OnClientEvent:Connect(function(message)
print(message)
end)

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