This Works perfectly in studio however it wont work in the actual game Note- its a script in the NPC I tried making it a localscript in the npc but it didnt work
local distance = 500
players = nil; --Where we are going to store all the players
dummy = game.Workspace.Berserker; --Dummy reference
currentPlayerFollowing = nil; --The current player the zombie is following
while wait(1) do --Forever loop
players = game.Players:GetChildren(); --Grab all the Players currently in the game
for i = 0, table.getn(players), 1 do --Go through all of the players
if (players[i] ~= nil and (math.abs(players[i].Character.UpperTorso.Position.X - dummy.UpperTorso.Position.X)) <= 10) then --Subtract the distance between the player and the zombie
currentPlayerFollowing = players[i]; --Add the player to the currentPlayerFollowing reference so the zombie can follow them
end
if (currentPlayerFollowing ~= nil) then --If the player is there
dummy.Humanoid.WalkToPoint = currentPlayerFollowing.Character.UpperTorso.Position --Walk to the player
end
end
end

1 comment
This was also posted but it never got answerd though