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

When your making a script how would it tell the difference from a zombie nps and a player?

Asked by 3 years ago

When your making a script what would you put for the script to detect if its a zombie npc and not a player?

0
well i usually check for an UpperTorso, or a RightFoot, or something like that xIshFudge 84 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

you would either check if there's a player instance with the same name as the NPC, or use the method, Players:GetPlayerFromCharacter(character) which will return a player object associated with the character passed to it, or nil if the character passed to it is not a player's character..

i recommend using the second method, because maybe in an extremely rare case there might a be player who is named the same thing as an NPC, therefore giving you wrong results.

0
wdym RenDevelopment 15 — 3y
Ad

Answer this question