Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local character = script.Parent
- local humanoid = character.Humanoid
- local start = workspace.start
- local finish = workspace.finish
- local startmovebody = character.Torso
- while true do
- humanoid:MoveTo(start.Position) -- Move to the waypoint
- humanoid.MoveToFinished:Wait()
- local service = game:GetService('PathfindingService')
- local path = service:FindPathAsync(startmovebody.Position,finish.Position)
- local points = path:GetWaypoints()
- for key,value in pairs(points) do
- wait(0.1)
- local part = Instance.new ('Part')
- part.Parent = workspace
- part.Name = 'Part'
- part.Anchored = true
- part.CanCollide = false
- part.Position = value.Position
- part.Size = Vector3.new(1,1,1)
- part.Transparency = 1
- humanoid:MoveTo(part.Position)
- humanoid.MoveToFinished:Wait()
- part:Destroy()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment