Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

FireClient: player argument must be a Player object?

I never used FireClient Before, so this is my first attempt. For some reason it gives me the error FireClient: player argument must be a Player object, even tho the player argument is the player.

script:

script.Parent.ClickDetector.MouseClick:Connect(function(player)
	print(player)
	game.ReplicatedStorage.RemoteEvent:FireClient(game.Players:GetPlayerFromCharacter(player),script.Parent.Parent.Name.Value)
end)

1 comment

0

You know as this would be in the workspace then the client can just read the value. No remotes are needed.

1 answer

✓ Accepted answer

The problem was that you putted the player at line 3 at game.Players:Getpltfromcharacter, the ClickDetector MouseClick function gives you the player, not its character

script.Parent.ClickDetector.MouseClick:Connect(function(player)
    print(player)
    game.ReplicatedStorage.RemoteEvent:FireClient(player,script.Parent.Parent.Name.Value)
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.