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:
1 | script.Parent.ClickDetector.MouseClick:Connect( function (player) |
2 | print (player) |
3 | game.ReplicatedStorage.RemoteEvent:FireClient(game.Players:GetPlayerFromCharacter(player),script.Parent.Parent.Name.Value) |
4 | end ) |
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
1 | script.Parent.ClickDetector.MouseClick:Connect( function (player) |
2 | print (player) |
3 | game.ReplicatedStorage.RemoteEvent:FireClient(player,script.Parent.Parent.Name.Value) |
4 | end ) |