Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

THIS IS SOLVED IT WAS BECAUSE I DIDN'T ANCHOR IT?!

local Pfs = game:GetService("PathfindingService")

local human = script.Parent.Humanoid
local torso = script.Parent
local man = workspace:WaitForChild("Auxigin")
local cry = script.Parent.Cry
local idiot = true
local easy = true

local path = Pfs:CreatePath()
while wait(0.001) do
path:ComputeAsync(script.Parent.PrimaryPart.Position, man.HumanoidRootPart.Position)
local waypoints = path:GetWaypoints()
end

for i, v in pairs(waypoints) do
	human:MoveTo(v.Position)
	human.MoveToFinished:Wait()
end

if human.Health < 100 then
	if idiot == true then
		idiot = false
		script.Parent.Head.face.Texture = "http://www.roblox.com/asset/?id=861024822"
		script.Parent.Head.BrickColor = BrickColor.new("Bright red")
	cry:Play()
	wait(10)
	human.Health = 100
	cry:Pause()
	script.Parent.Head.BrickColor = BrickColor.new("Lime green")
	script.Parent.Head.face.Texture = "http://www.roblox.com/asset/?id=15175343"
	idiot = true

end
end



This is the script, it doesn't work on a cube with eyes though, is there anything wrong? Or can pathfinding only be used with characters?

1 answer

This is because of your while loop. This is running forever, and the rest of the script doesn't run.

1 comment

0

Oh wow it was because I anchored it. I want to die.

This discussion is preserved as it was. New answers, comments, and votes are closed.