The :MoveTo script is not completely my own
-
What do you want to achieve? That my :MoveTo finishes
-
What is the issue? Its not walking to the last points. BUT he walks to the first few points*
VIDEO:
- What solutions have you tried so far? I’ve tried looking but I couldn’t find anything
IDK if this is helpful information but before he walks to the other points he is playing a animation from ANOTHER script
:MoveTo script
--// Variables
local Dummy = script.Parent
local waypoints = workspace.waypoints
--// Loops trough waypoints
for waypoint = 1, #waypoints:GetChildren() do
Dummy.Humanoid:MoveTo(waypoints[waypoint].Position)
Dummy.Humanoid.MoveToFinished:Wait()
print("Next point finished")
end
Other script:
--// Variables debounce
local waitSeconds = 1
local isTouched = false
--// When tree is touched function
script.Parent.PrimaryPart.Touched:Connect(function(hit)
if not isTouched then
isTouched = true
if hit.Parent.Name == "Dummy" then -- Checks if the person who touches is a Dummy
local animation = hit.Parent.AI.DestroyTree
local humanoid = hit.Parent.Humanoid
local destroyTreeAnim = humanoid:LoadAnimation(animation) -- Tree slapping animation
for count = 0, hit.Parent.config.RepeatAnim.Value, 1 do
destroyTreeAnim:Play()
wait(2)
end
script.Parent:Destroy()
wait(waitSeconds)
isTouched = false
end
end
end)
I hope someone can help!