Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

F.E. game test not accepting player argument during fireclient()?

Asked by 7 years ago

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.

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() TheHospitalDev 1134 — 7y
0
Oh okay, thanks. DivineObliteration 9 — 7y

Answer this question