FireClient: player argument must be a Player object

Hi, I’m getting this error and I don’t know how can I fix that.

If someone help me I appreciated.

The script:

local button = script.Parent

button.MouseButton1Click:Connect(function(player)
	game.ReplicatedStorage.Error:FireClient(player, "Error", "This is an Error!", 3)
end)

button.MouseButton1Click does not transfer the player, you need to know him yourself

I fixed the problem (thanks for the reply btw)

local button = script.Parent

button.MouseButton1Click:Connect(function(player)
	local playerObject = game.Players:GetPlayerFromCharacter(player)
	if playerObject then
		game.ReplicatedStorage.Error:FireClient(playerObject, "Error", "This is an Error!", 3)
	end
end)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.