OnClientEvent player printing as "nil"

I want to have a server script fire a RemoteEvent to the client with a player, which is caught in a local script.

I have the local script printing out the player, but it always prints as “nil”

I have tried GetPlayerFromCharacter(), hard coding, task.wait().

The local script is in ReplicatedFirst.

Here is the hard coded code:

--Server Script
game.ReplicatedStorage.RemoteEvent:FireClient(game.Players.Rob0tmaster)
--Local Script
game.ReplicatedStorage:WaitForChild("RemoteEvent").OnClientEvent:Connect(function(plr)
	task.wait(1)
	print(plr)
end)

The FireClient method of a remote event, and the InvokeClient of a remote function, use the first argument you pass in as the player who the remote is firing for. When you’re testing, you’re the only player, but in a regular server there can be multiple players, and since FireClient only fires for one client, the server needs to know which player. Since the first argument is already used, it doesn’t actually pass over to the client as a parameter. You need to write this if you want to print the player on the client:

game.ReplicatedStorage.RemoteEvent:FireClient(game.Players.Rob0tmaster, game.Players.Rob0tmaster)