How can I Make that whenever you attack an npc it chase the player that attacked him

It’s just test script, not final version, so can you show what it prints?

sorry for the late reply
image

Try this script now:

local nowPlr = nil
local function StartToChaseThisPlayer(player)
      local playerCharacter = player.Character or player.CharacterAdded:Wait()
      local playerRoot = playerCharacter:WaitForChild("HumanoidRootPart")
      local playerHumanoid = playerCharacter:WaitForChild("Humanoid")
      repeat task.wait()
      if playerRoot and playerHumanoid then
       humanoid:MoveTo(playerRoot.Position)
       humanoid.MoveToFinished:Wait()
       end
       until (nowPlr ~= player or playerHumanoid.Health <= 0 or humanoid.Health <= 0)
end
1 Like

its working now! thank you so much

1 Like

No problem,also I am very sorry for the fact that we spent week or more for this simple error.

1 Like

Dont worry Thanks for everything

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.