if anyone is willing to help me out ty bc im not sure what is the main cause of an npc not even moving.
One silly mistake I’ve made is the NPC will attempt to follow itself sometimes. Maybe that’s the case with your script?
possibly yeah but I dont know exactly. Though that could be the main problem.
also if anyone else wanna help out I will appreciate it.
sending this message 2nd time, sorry if this annoys you.
Sending this third time. I just want to get this problem over with so I can keep working on other features.
sending this the fourth time. it’s been over a month now.
Perhaps this is the issue? Is your character R6?
Sorry its been too long but yes the character is r6
MFW ChatGPT response
Use Humanoid:MoveTo() for moving the npc closer
The NPC is still stuck
heres my script so far
local humanoid = script.Parent.Humanoid
while wait() do
local closestDist = math.huge
local closestHumanoid = nil
for _, child in pairs(workspace:GetChildren()) do
if child:IsA('Model') and child:FindFirstChild('Humanoid') and child.Humanoid ~= humanoid and child.Humanoid.Health > 0 then
local dist = (script.Parent.Torso.Position - child.Torso.Position).magnitude
if dist < closestDist and dist < 30 then
closestDist = dist
closestHumanoid = child.Humanoid
end
end
end
if closestHumanoid then
humanoid.WalkSpeed = 20
humanoid:MoveTo()
script.Parent.Torso.Touched:connect(function()
humanoid.Jump = true
end)
if humanoid then
script.Parent.HealArea.Script.Enabled = true
end
else
humanoid.WalkSpeed = 0
end
end
Something or some part of the script might be breaking the movement of it. Recall that it is unanchored as well.
I also tried on the new game with the exact model and it worked but not on the game im working on