✓ Accepted answer
when you call FireServer, the function fires the OnServerEvent signal with the player that called the FireServer, and all extra arguments that you pass to FireServer().. therefore, you don't need to do FireServer(player), b/c the engine does it automatically for you.
so the following should hopefully answer ur question:
LocalScript:
game.ReplicatedStorage.RemoteEvent:FireServer()
Server script:
game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(player)
print(player.Name," fired the server")
end)
keep in mind that LocalScripts are "local" to a player.. they run on a player's computer.. they are meant to handle all the client(player) sided things..
3 comments
If you want code that only runs for a single player, then you'll have to run that code in a LocalScript, which would be located inside of the player that you want the code to run for.
Also, I don't see why you're passing in the player variable when you call the FireServer function, because that's already done for you when you call the function. The first parameter received on the server end is always the player that fired the RemoteEvent.
If you want to use RemoteEvents, you would have to use 2, I assume. The first one would be the :FireServer(player,args) event, and the second event would be the :FireClient(player,args) event. But, this is very code heavy and can get very messy and confusing.