FireClient: player argument must be a Player object

Hello

script.Parent.MouseClick:Connect(function()
	script.dialog:FireClient(plr)
end)

When I’m trying to use a FireClient event, it will always display the error in the title. I’ve been dealing with this issue around a week so I need a workaround with it.

Thanks

What is plr? You need to define this before you can use it.

you need to get the player, I suppose that if you are using the mouseclick event it will be a clickdetector, which as an argument returns the player who touched it, so you could simply include it in the parameters

script.Parent.MouseClick:Connect(function(plr)
	script.dialog:FireClient(plr)
end)
1 Like

Nevermind, already fixed it,

game.Players.PlayerAdded:Connect(function(plr)
script.Parent.MouseClick:Connect(function()
	script.dialog:FireClient(plr)
end)
end)

A player is needed for it to behave.

Sorry for bothering

It was much easier to add the plr in the parameters of the click function

1 Like

When I did that it kind of errored

???There should be no error, unless you had written it wrong.

1 Like

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