Detect from what player's localscript an event was fired

When I fire a RemoteEvent from a localscript, is there a way to detect on the server from what player it got fired? (i want to use it cause a part generated by script should only be visible for teammates, so i need to make sure i know who fired the event)

Thanks for reading

1 Like

The first parameter of the remote event from client to server is the player

1 Like

How can I retrieve that first parameter?

RemoteEvent.OnServerEvent:Connect(funcion(player) -- parameter 

end)
1 Like

so that basically does whatever is inside there for that one player who fired the event, right?

No, it does not, it is just a parameter.

RemoteEvent.OnServerEvent:Connect(funcion(player) -- parameter 
        print(player.Name) -- eg.
end)
1 Like

no but, i mean if you do the print(player.Name) you will print the name of the player from whose localscript the event got fired, right?

Yes it would do that.

RemoteEvent.OnServerEvent:Connect(funcion(player) -- parameter 
        print(player.Name) -- eg.
end)

Output:
theworldis_socruel

2 Likes