Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local humanoid = script.Parent.Humanoid
- local torso = script.Parent.HumanoidRootPart
- local ps = game:GetServicePath(PathWaypoint)
- while true do
- local path = ps:CreatePath({AgentHeight = 1, AgentRadius = 1})
- wait(math.random(2,3.5))
- end
- local humanoid = script.Parent.Humanoid
- local torso = script.Parent.HumanoidRootPart
- local ps = game:GetService("PathfindingService")
- while true do
- local pos = torso.CFrame.Position + Vector3.new(math.random(-50,50),0,math.random(-50,50))
- local path = ps:CreatePath({AgentHeight = 1, AgentRadius = 1})
- local comp = path:ComputeAsync(torso.CFrame.Position, pos)
- wait(math.random(2,3.5))
- end
- local humanoid = script.Parent.Humanoid
- local torso = script.Parent.HumanoidRootPart
- local ps = game:GetService("PathfindingService")
- while true do
- local pos = torso.CFrame.Position + Vector3.new(math.random(-50,50),0,math.random(-50,50))
- local path = ps:CreatePath({AgentHeight = 1, AgentRadius = 1})
- local comp = path:ComputeAsync(torso.CFrame.Position, pos)
- if path.Status == Enum.PathStatus.Succes then
- local waypoints = path:GetWaypoints()
- for _,point in pairs(waypoints) do
- humanoid:MoveTo(point.position)
- local part = Instance.new("Part")
- part.CanCollide = false
- part.Locked = true
- part.Anchored = true
- part.Material = Enum.Material.Neon
- part.BrickColor = BrickColor.Red()
- part.Size = Vector3.new(1,0.5,1)
- part.CFrame = CFrame.new(point.position)
- part.Transparency = 0.25
- part.Parent = workspace
- humanoid.MoveToFinished:Wait()
- part:Destroy()
- end
- end
- wait(math.random(2,3.5))
- end
- local humanoid = script.Parent.Humanoid
- local torso = script.Parent.HumanoidRootPart
- local ps = game:GetService("PathfindingService")
- math.randomseed(tick(1))
- while true do
- local pos = torso.CFrame.Position + Vector3.new(math.random(-50,50),0,math.random(-50,50))
- local path = ps:CreatePath({AgentHeight = 1, AgentRadius = 1})
- local comp = path:ComputeAsync(torso.CFrame.Position, pos)
- if path.Status == Enum.PathStatus.Succes then
- local waypoints = path:GetWaypoints()
- humanoid.Seated:Connect(function(seated)
- if seated == true then
- print("seated")
- humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
- end
- end)
- path.Blocked:Connect(function()
- print("blocked!")
- humanoid:MoveTo(torso.CFrame.Position)
- end)
- for _,point in pairs(waypoints) do
- humanoid:MoveTo(point.Position)
- local part = Instance.new("Part")
- part.CanCollide = false
- part.Locked = true
- part.Anchored = true
- part.Material = Enum.Material.Neon
- part.BrickColor = BrickColor.Red()
- part.Size = Vector3.new(point.Position)
- part.Transparency = 0.25
- part.Parent = workspace
- if point.Action == Enum.PathWaypointAction.Jump then
- print("jumping")
- humanoid:ChangeStatus(Enum.HumanoidStateType.Jumping)
- end
- humanoid.MoveToFinished:Wait()
- part:Destroy()
- end
- end
- wait(math.random(2,3.5))
- end
- local ps = game:GetService("PathfindingService")
- math.randomseed(tick())
- for _,npc in pairs(workspace.NPCS:GetChildren()) do
- spawn(function(thread)
- while true do
- local humanoid = npc.Humanoid
- local torso = npc.HumanoidRootPart
- local pos = torso.CFrame.Position + Vector3.new(math.random(-50,50),0,math.random(50,50))
- local path = ps:CreatePath({AgentHeight = 1, AgentRadius = 1})
- local comp = path:ComputeAsync(torso.CFrame.Position, pos)
- if path.Status == Enum.PathStatus.Success then
- local waypoints = path:GetWaypoints()
- humanoid.Seated:Connect(function(seated)
- if seated == true then
- print("seated")
- humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
- end
- end)
- path.Blocked:Conenct(function()
- print("blocked!")
- humanoid:MoveTo(torso.CFrame.Position)
- end)
- for _,point in pairs(waypoints) do
- humanoid:MoveTo(point.Position)
- local part = Instance.new("Part")
- part.CanCollide = false
- part.Locked = true
- part.Anchored = true
- part.Material = Enum.Material.Neon
- part.BrickColor = BrickColor.Red()
- part.Size = Vector3.new(1,0.5,1)
- part.CFrame = CFrame.new(point.Position)
- part.Transparency = 0.25
- part.Parent = workspace
- if point.Action == Enum.PathWaypointAction.Jump then
- print("jumping")
- humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
- end
- humanoid.MoveToFinished:Wait()
- part:Destroy()
- end
- end
- wait(math.random(2,3.5))
- end
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement