Having problems with this script here:

if Player.Parent.ClassName == "Model" then -- Part > Player
		game.Players[Player.Parent.Name].Duel:FireClient(Player.Parent, 		script.Parent.Parent.Parent.Name, script.Parent.Parent.Name, Player.Parent.Name)
end

It's inside a .touched event where Player is the part that touched it, if it's a leg or arm or something it checks the parent to see if it's the player, then fires client to do something else, but when I test it in test mode, I get this error in the server output: "Player argument of fireclient must be a player object!"(<Or something like that <), and I don't get why it does this because the player argument is leg or whatever.Parent, can anybody explain why this isn't working or how to fix? Thanks.

2 comments

0

When you do Player.Parent you are getting the player's model in workspace. What is wants is the Player instance, which is under "game.Players". Try to learn about game.Players:GetPlayerFromCharacter()

0

Oh okay, thanks.