#Workspace.Bonnie.BonnieBasic:71: attempt to index number with 'MoveTo' - Server - BonnieBasic:71

1 messages · Page 1 of 1 (latest)

marsh wadi
#
if success then
    timeDecider()
    destDecider()
    task.wait(time)
    for humanoid, destinationVector in pairs(path:GetWaypoints()) do
        if pathfindEnabled == false then
            print("pathfindEnabled == false")
            break
        end
        print("success")
        humanoid:MoveTo(destinationVector)
        humanoid.MoveToFinished:Wait()
    end
    RunServ.Heartbeat:Wait()
else
    warn(errorMessage)
end```
solar reef
#

what is destinationVector

ripe ermine
#

lemme check documentation rq

solar reef
#

your right

#

shouldnt it be

#

for _, waypoint in ipairs(path:GetWaypoints()) do

ripe ermine
#

yeah :GetWaypoints() returns an array therefore “humanoid” is an int

solar reef
#

or something like that

ripe ermine
#

yup

marsh wadi
marsh wadi
#

ah, wait

#

lemme try fixing it myself first

#

before asking you

solar reef
#

or something

marsh wadi
#

i do not have a variable named in

#

trying this out because its in pairs

#

it worked but it did not pathfind like i wanted it to, gonna do some more testing and such

#

thank you guys for the help

#

i appreciate it

solar reef
#

im not extremely familiar with pathfinding so i cant really help

#

but good luck!

ripe crest
#

movetofinished:wait() is a newb trap do it properly like shown on that page 👍