Hello, recently I’ve been following a youtubers tutorial and trying to make a game.
I was creating the pathfinding script when I got an error which my head cannot fix.
The script:
local Maxwell = workspace:WaitForChild("Maxwell")
local HRP = Maxwell:WaitForChild("HumanoidRootPart")
local Humanoid = Maxwell:WaitForChild("Humanoider")
local locations = script.Parent
local randomLocations = locations:WaitForChild("RandomLocations")
local path = pathFindingService:CreatePath()
local randomLocation = randomLocations:FindFirstChild(math.random(1,3))
path:ComputeAsync(HRP.Position, randomLocation.Position)
local waypoints = path:Getwaypoints()
Humanoid:MoveTo(randomLocation.Position)
Does anyone know why and how to fix this?