Im Planning to make an Npc to follow me but i somehow can't. How is this happening?
local h = script.Parent.Humanoid local torso = script.Parent.Torso local spawnCF = torso.CFrame function findPlayer() for _,v in next, game.Players:GetPlayers() do if v.Character then local char = v.Character if char:FindFirstChild("Humanoid") and char:FindFirstChild("Torso") then local ptorso = char.Torso if (ptorso.Position - torso.Position).magnitude <= 20 then return v end end end end return nil end while wait() do local player = findPlayer() if player ~= nil then h.WalkToPoint = player.Character.Torso.Position else h.WalkToPoint = spawnCF.p end end