Hello! So now I'm trying to make some scripted NPCs. So I have seen the way that some Zombie models work and how they walk to a humanoid. The script is very complicated though. So I decided to make my own simpler version! I actually made the base of this script using another model I made but Modified it. So basically when the player enters the NPC is supposed to walk to the player's position (Torso)
It doesn't work however. When I put the position of the torso, the NPC just walks to 0,0,0. But if I take the Position out and put it to a specific vector3. it walks to it. So I know it's working but I don't know why it won't walk tot he player. Any help?
game.Players.PlayerAdded:connect(function(p)--When a Player joins this function is triggered!
p.CharacterAdded:connect(function(c)-- when a character is added (A physical robloxian) this function will be triggered! this also happens when you respawn!
spawn(function()--When a character is spawned this function is triggered!
while wait() do--This is an infinite loop!
script.Parent.Humanoid.WalkToPoint = Vector3.new(c.Torso.Position) --Won't walk to this
end
end)
end)
end)

3 comments
it wouldn't be Humanoid.WalkToPoint(c.Torso.Position)?
Aha!! This works! I guess that would be simpler. Sorry for the long response, I had some things I had to take care of. Thanks!
You're welcome.