Currently, I'm in the process of designing a NPC that I'm going to use for one of my games. However, this script isn't working the way I'd like it to. How ideas on how I could fix it? The whole point of the script is to make my NPC jump when it touches a part but not when it touches the part of a Player.
function onTouched(part)
if part.Name ~= {"Torso","Left Arm","Right Arm","Left Leg","Right Leg","Head"} then
script.Parent.Parent.Zombie.Jump = false
if else
script.Parent.Parent.Zombie.Jump = true
end
end
end
script.Parent.Touched:connect(onTouched)

4 comments
Here try this: function onTouched(part)02 local Humanoid = part:FindFirstChild("Humanoid") if Humanoid == nil then03 script.Parent.Parent.Zombie.Jump = false04 if else05 06 script.Parent.Parent.Zombie.Jump = true07 08 end09 10 11 end12end13 14script.Parent.Touche
Remove the extra "if" next to else and remove an "end"
Thanks, I'll try that.
I tried both suggestions and still didn't have any success :'(