I don't know how to get the name of the client which the Server event was fired by. Anyone know how?
✓ ANSWER ACCEPTED
Remote Events: How to get the name of the player the event was fired by?
1 answer
✓ Accepted answer
The first argument on OnServerEvent is the player that fired it. Just use player.Name
LocalScript
RemoteEvent:FireServer("hello")
Script
RemoteEvent.OnServerEvent:Connect(function(player,word)
print(player.Name)
print(word) --> hello
end)
Just remember that the player parameter goes first, so although "hello" is the first argument in the LocalScript, it is the 2nd parameter in the script.
This discussion is preserved as it was. New answers, comments, and votes are closed.
