Ad
Still have questions? Join our Discord server and get real time help.
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 4 months 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 — 4mo

1 answer

Log in to vote
0
Answered by 4 months 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 — 4mo
Ad

Answer this question