Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Your title should be specific! Describe your problem concisely.?

Asked by 5 years ago

So i was trying to post a Question but it only will say " Your title should be specific! Describe your problem concisely" Any was here is the script the for loop at line 12 never runs.

local PathfindingService = game:GetService("PathfindingService")
local char = script.Parent
local Humanoid = char.Humanoid
while true do
    local path = PathfindingService:CreatePath()
    path:ComputeAsync(char.HumanoidRootPart.Position, Vector3.new(char.PrimaryPart.Position.X + math.random(-20,20),char.PrimaryPart.Position.Y + math.random(-20,20),char.PrimaryPart.Position.X + math.random(-20,20)))
    path.Blocked:Connect(function()
        path:ComputeAsync(char.HumanoidRootPart.Position, Vector3.new(char.PrimaryPart.Position.X + math.random(-20,20),char.PrimaryPart.Position.Y + math.random(-20,20),char.PrimaryPart.Position.X + math.random(-20,20)))
    end)
    local waypoints = path:GetWaypoints()
    print("Up to For loop")
    for I, waypoint in pairs(waypoints) do
        print("For loop") -- never gets printed in consale 
        char.HumanoidRootPart:MoveTo(waypoint.Position)
        wait(0.1)
    end
    wait(1)
end
0
I tried the loop in a local script, works perfectly fine for me(I replaced "char.HumanoidRootPart:MoveTo" with "Humanoid:MoveTo") xEmmalyx 285 — 5y
0
it needs to run on sever side and its not a R15 or R6 avatar kittensgaming123 19 — 5y
1
Your title should be specific describing your problem concisely. hiimgoodpack 2009 — 5y
0
I'm not sure if this will help it, but I think the I at line 12 needs to be lowercase. sngnn 274 — 5y
0
I needs to be lowercased. raid6n 2196 — 5y

Answer this question