Hello! I am trying to make it so a UI appears when the player dies. To do this i am using a remote event:FireClient() but for some reason it doesnt quite work. and i get a error FireClient: player argument must be a Player object
Here is the code:
Server Script (In ServerScriptService)
local gameoverevent = game.ReplicatedStorage:WaitForChild("GameOver")
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local humanoid = character:WaitForChild("Humanoid")
humanoid.Died:Connect(function(player)
gameoverevent:FireClient(player)
end)
end)
end)
Local Script (In StarterPlayerScripts):
local gameoverevent = game.ReplicatedStorage:WaitForChild("GameOver")
local playergui = script.Parent.Parent:WaitForChild("PlayerGui")
local gameover = playergui.GameOver
gameoverevent.OnClientEvent:Connect(function(player)
gameover.Enabled = true
gameover.GAMEOVER:Play()
end)
Im not quite sure what im doing wrong here. Any reason why?

1 comment
In your Script there is no parameter for Humanoid.Died just leave it blank