Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local StartPoints = {
- Vector3.new(2.413, 63.404, -192.273),
- Vector3.new(90, 59.124, -106.053),
- Vector3.new(-89.773, 64.425, -103.589),
- Vector3.new(87.907, 65.74, 13.814),
- Vector3.new(-89.515, 66.008, 15.945),
- Vector3.new(88.986, 64.027, 132.04),
- Vector3.new(-90.259, 65.74, 134.974),
- Vector3.new(60.493, 63.391, 190.158),
- Vector3.new(-2.715, 65.74, 188.564),
- Vector3.new(-61.894, 65.74, 190.386)
- }
- local EndPoints = {
- Vector3.new(8, 91, -486),
- Vector3.new(388.82, 79.961, -106.486),
- Vector3.new(-384.038, 91.046, -103.333),
- Vector3.new(378.927, 77.956, 13.814),
- Vector3.new(-385.485, 78.461, 17.784),
- Vector3.new(389.247, 80.141, 131.679),
- Vector3.new(-392.683, 82.294, 136.576),
- Vector3.new(58.633, 78.845, 490.814),
- Vector3.new(-1.732, 79.544, 492.335),
- Vector3.new(-60.728, 85.767, 492.501)
- }
- for i,v in pairs(StartPoints) do
- local part = Instance.new("Part")
- part.Parent = game:GetService("Workspace"):FindFirstChild("Points")
- part.CanCollide = false
- part.Transparency = 1
- part.Name = "Start"..i
- part.Position = v
- part.Size = Vector3.new(1,1,1)
- part.Anchored = true
- end
- for i,v in pairs(EndPoints) do
- local part = Instance.new("Part")
- part.Parent = game:GetService("Workspace"):FindFirstChild("Points")
- part.CanCollide = false
- part.Transparency = 1
- part.Name = "End"..i
- part.Position = v
- part.Size = Vector3.new(1,1,1)
- part.Anchored = true
- end
- while wait(2) do
- local Number = math.random(1, #StartPoints)
- local PFS = game:GetService("PathfindingService")
- local hum = script.Parent:WaitForChild("Humanoid")
- local HumanoidRootPart = script.Parent:WaitForChild("HumanoidRootPart")
- hum.Parent.PrimaryPart:SetNetworkOwner(nil) -- change character to the variable that your npc is in.
- local GoingPath = PFS:CreatePath()
- GoingPath:ComputeAsync(HumanoidRootPart.Position, game:GetService("Workspace"):WaitForChild("Points"):WaitForChild("Start"..Number).Position)
- local GoingWaypoints = GoingPath:GetWaypoints()
- for i, waypoint in pairs(GoingWaypoints) do
- if waypoint.Action == Enum.PathWaypointAction.Jump then
- hum.Jump = true
- end
- --[[local part = Instance.new("Part")
- part.Shape = "Ball"
- part.Name = "Part"..i
- part.CanCollide = false
- part.Anchored = true
- part.Parent = game.Workspace.Parts
- part.Position = Vector3.new(waypoint.Position.X, waypoint.Position.Y + 2.5, waypoint.Position.Z)
- part.Size = Vector3.new(0.5,0.5,0.5)
- part.Transparency = 0.5
- part.Color = Color3.fromHex("#FFFFFF")
- part.Material = Enum.Material.Neon--]]
- end
- for i, waypoint in pairs(GoingWaypoints) do
- if waypoint.Action == Enum.PathWaypointAction.Jump then
- hum:ChangeState(Enum.HumanoidStateType.Jumping)
- end
- hum:MoveTo(waypoint.Position)
- hum.MoveToFinished:Wait(2)
- end
- local path = PFS:CreatePath()
- path:ComputeAsync(HumanoidRootPart.Position, game:GetService("Workspace"):WaitForChild("Points"):WaitForChild("End"..Number).Position)
- local waypoints = path:GetWaypoints()
- for i, waypoint in pairs(waypoints) do
- if waypoint.Action == Enum.PathWaypointAction.Jump then
- hum.Jump = true
- end
- --[[local part = Instance.new("Part")
- part.Shape = "Ball"
- part.Name = "Part"..i
- part.CanCollide = false
- part.Anchored = true
- part.Parent = game.Workspace.Parts
- part.Position = Vector3.new(waypoint.Position.X, waypoint.Position.Y + 2.5, waypoint.Position.Z)
- part.Size = Vector3.new(0.5,0.5,0.5)
- part.Transparency = 0.5
- part.Color = Color3.fromHex("#FFFFFF")
- part.Material = Enum.Material.Neon--]]
- end
- for i, waypoint in pairs(waypoints) do
- if waypoint.Action == Enum.PathWaypointAction.Jump then
- hum:ChangeState(Enum.HumanoidStateType.Jumping)
- end
- hum:MoveTo(waypoint.Position)
- hum.MoveToFinished:Wait(2)
- end
- local CommonTime = 0
- local Obby = ""
- if Number == 1 then
- CommonTime = 16.7
- Obby = "Original Timed Obby"
- elseif Number == 2 then
- CommonTime = 11.7
- Obby = "Easy Timed Obby"
- elseif Number == 3 then
- CommonTime = 17
- Obby = "Medium Timed Obby"
- elseif Number == 4 then
- CommonTime = 13
- Obby = "Easy Killpart Obby"
- elseif Number == 5 then
- CommonTime = 16.5
- Obby = "Medium Killpart Obby"
- elseif Number == 6 then
- CommonTime = 14.2
- Obby = "Easy Wallhop Obby"
- elseif Number == 7 then
- CommonTime = 23
- Obby = "Medium Wallhop Obby"
- elseif Number == 8 then
- CommonTime = 17.3
- Obby = "Hard Timed Obby"
- elseif Number == 9 then
- CommonTime = 19.5
- Obby = "Hard Killpart Obby"
- elseif Number == 10 then
- CommonTime = 23
- Obby = "Hard Wallhop Obby"
- end
- local Time = math.random(CommonTime * 10 - 5, CommonTime * 10 + 5) / 10
- local phrases = {
- "Yay! I made "..Time.." at "..Obby,
- "Let's go! I got "..Time.." on the "..Obby.."!"
- }
- local phrase = phrases[math.random(1, #phrases)]
- local num = math.random(1,10)
- local bchat = game:GetService("ReplicatedStorage"):WaitForChild("NpcBubbleChat"):Clone()
- bchat.Parent = script.Parent.Head
- bchat:WaitForChild("TextLabel").Text = phrase
- print(num)
- if num == 3 then
- print("Good!")
- game.ReplicatedStorage.RemoteEvents.NPCFinishValues.Phrase.Value = phrase
- game.ReplicatedStorage.RemoteEvents.NPCFinishValues.NPCName.Value = script.Parent.Name
- if game.ReplicatedStorage.RemoteEvents.NPCFinishValues.Update.Value then
- game.ReplicatedStorage.RemoteEvents.NPCFinishValues.Update.Value = false
- else
- game.ReplicatedStorage.RemoteEvents.NPCFinishValues.Update.Value = true
- end
- while bchat:WaitForChild("TextLabel").TextTransparency > 0 do
- bchat:WaitForChild("TextLabel").TextTransparency -= 0.1
- bchat:WaitForChild("TextLabel").BackgroundTransparency -= 0.1
- wait(0.05)
- end
- end
- wait(3)
- HumanoidRootPart.CFrame = game:GetService("Workspace"):WaitForChild("Points"):WaitForChild("Start"..Number).CFrame
- wait(1)
- if num == 3 then
- while bchat:WaitForChild("TextLabel").TextTransparency < 1 do
- bchat:WaitForChild("TextLabel").TextTransparency += 0.1
- bchat:WaitForChild("TextLabel").BackgroundTransparency += 0.1
- wait(0.05)
- end
- end
- bchat:Destroy()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement