So, I have a RemoteEvent in ReplicatedStorage, which was created by a serverscript, but I need to get the player's teamcolor. But since I can't use LocalPlayer, is there anyway to declare a localplayer in a serverscript?
Since the Script belongs to the server, there can't be a local player. But when clients fire remote events. The first argument is the player who fired it. If I understand your question correctly, that should be what you need.
1 | local remote = game:GetService( "ReplicatedStorage" ):WaitForChild( "RemoteEvent" ) |
2 |
3 | remote.OnServerEvent:Connect( function (player, otherArguments) |
4 | --Works fine |
5 | print (player.Name .. " has fired an event!" ) |
6 | end ) |