Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -------------------->> Services <<--------------------
- local cloneref = cloneref or function (...)
- return ...
- end
- local Services = setmetatable({}, {
- __index = function(self, service)
- return cloneref(game:FindService(service)) or cloneref(game:GetService(service)) or cloneref(game:service(service))
- end
- })
- local WorkSpace = Services.Workspace
- local Players = Services.Players
- -------------------->> Variables <<--------------------
- local Player = Players.LocalPlayer
- local PlayerGui = Player.PlayerGui
- local NotificationStack = PlayerGui.Notifications.NotificationStack
- local Character = Player.Character
- local HumanoidRootPart = Character.HumanoidRootPart
- local Shards = WorkSpace.Shards
- local Hotel = WorkSpace.Hotel
- local Portals = WorkSpace.Portals
- local EntrancePortal = Portals.EntrancePortal
- local Elevator = Hotel.Elevator
- local InsideElevator = Elevator.ElevatorInside
- -------------------->> Main <<--------------------
- getgenv().TPAlready = getgenv().TPAlready or false
- getgenv().BoardsBroke = getgenv(). BoardsBroke or false
- getgenv().CollectedAll = getgenv().CollectedAll or false
- getgenv().ReturnedToAlt = getgenv().ReturnedToAlt or false
- getgenv().ReturnedToPort = getgenv().ReturnedToPort or false
- if workspace:GetAttribute("GameStarted") == nil and getgenv().TPAlready == false then
- HumanoidRootPart.CFrame = InsideElevator.CFrame
- end
- repeat task.wait() until Hotel:FindFirstChild("Maze") ~= nil
- local Maze = Hotel.Maze
- local Interactable = Maze.Interactable
- local RingAltarModel = Maze.Rooms.Main.RingAltar
- local RingAltar = RingAltarModel.Parts.RingAltar
- if workspace:GetAttribute("GameStarted") == nil and getgenv().TPAlready == false then
- HumanoidRootPart.CFrame = RingAltar.CFrame
- getgenv().TPAlready = true
- end
- if WorkSpace:GetAttribute("Skipped") == nil then
- local Button:TextButton = nil
- for i, v in pairs(NotificationStack:GetChildren()) do
- if v:IsA("Frame") and v:FindFirstChild("Buttons") ~= nil then
- if v.Buttons:FindFirstChild("Button1_Clone") == nil then continue end
- Button = v.Buttons.Button1_Clone
- firesignal(Button.MouseButton1Click)
- end
- end
- if Button == nil then
- local Connection
- Connection = NotificationStack.ChildAdded:Connect(function(Child:Frame)
- if Child:IsA("Frame") and Child:FindFirstChild("Buttons") ~= nil then
- if Child.Buttons:FindFirstChild("Button1_Clone") == nil then return end
- Button = Child.Buttons.Button1_Clone
- firesignal(Button.MouseButton1Click)
- Connection:Disconnect()
- Connection = nil
- end
- end)
- end
- end
- repeat print("waiting for game to start") task.wait() until WorkSpace:GetAttribute("GameStarted") == true
- repeat task.wait() until WorkSpace:GetAttribute("CurrentQuest") ~= nil
- repeat print("waiting for current quest: BREAK THE BOARDS") task.wait() until string.lower(WorkSpace:GetAttribute("CurrentQuest")) == "break the boards" or getgenv().BoardsBroke == true
- for _, v in pairs(Interactable:GetDescendants()) do
- if v.Name == "Interact" and v:FindFirstChildOfClass("RemoteEvent") ~= nil then
- v:FindFirstChildOfClass("RemoteEvent"):FireServer()
- task.wait(0.5)
- end
- end
- getgenv().BoardsBroke = true
- local function getClosestShard(objects)
- local closestShard = nil
- local shortestDistance = math.huge
- for _, object in ipairs(objects) do
- if object:IsA("BasePart") then
- local distance = (object.Position - HumanoidRootPart.Position).Magnitude
- if distance < shortestDistance then
- shortestDistance = distance
- closestShard = object
- end
- end
- end
- return closestShard
- end
- for i, v in pairs(Shards:GetChildren()) do
- if i >= 4 then break end
- local closest = getClosestShard(Shards:GetChildren())
- HumanoidRootPart.CFrame = closest.CFrame
- task.wait(1)
- end
- repeat task.wait() print("waiting for current quest: COLLECT ALL SHARDS") until string.lower(WorkSpace:GetAttribute("CurrentQuest")) == "collect all shards" or getgenv().CollectedAll == true
- for _, v in pairs(Shards:GetChildren()) do
- if v:FindFirstChild("TouchInterest") ~= nil then
- firetouchinterest(HumanoidRootPart, v, 0)
- firetouchinterest(HumanoidRootPart, v, 1)
- end
- end
- getgenv().CollectedAll = true
- repeat task.wait() print("waiting for current quest: GET BACK TO THE RING ALTAR") until string.lower(WorkSpace:GetAttribute("CurrentQuest")) == "get back to the ring altar" or getgenv().ReturnedToAlt == true
- if getgenv().ReturnedToAlt ~= true then
- for i = 1, 5 do
- HumanoidRootPart.CFrame = RingAltar.CFrame
- task.wait(0.6)
- end
- getgenv().ReturnedToAlt = true
- end
- repeat
- task.wait()
- if RingAltarModel:FindFirstChild("Interact") ~= nil then
- if RingAltarModel.Interact:FindFirstChildOfClass("RemoteEvent") ~= nil then
- RingAltarModel.Interact:FindFirstChildOfClass("RemoteEvent"):FireServer()
- end
- end
- if WorkSpace:GetAttribute("RingPieceCollected") ~= true then
- if RingAltarModel:FindFirstChild("Interact") ~= nil then
- if RingAltarModel.Interact:FindFirstChildOfClass("RemoteEvent") ~= nil then
- RingAltarModel.Interact:FindFirstChildOfClass("RemoteEvent"):FireServer()
- end
- end
- RingAltar.Attachment:Destroy()
- WorkSpace:SetAttribute("RingPieceCollected", true)
- end
- print("waiting for current quest: RETURN TO PORTAL")
- until string.lower(WorkSpace:GetAttribute("CurrentQuest")) == "return to the portal" or getgenv().ReturnedToPort == true
- if getgenv().ReturnedToPort ~= true then
- task.wait(2)
- repeat task.wait() HumanoidRootPart.CFrame = InsideElevator.CFrame until Hotel:FindFirstChild("Entrance") ~= nil and (HumanoidRootPart.Position - Hotel.Entrance.Lobby.MiddleCarpet.Position).Magnitude <= 100
- repeat task.wait() HumanoidRootPart.CFrame = Hotel.Events.MonkeysSpawn.Object.CFrame until #WorkSpace.Terrain.Enemies:GetChildren() > 2
- repeat task.wait() HumanoidRootPart.CFrame = Hotel.Events.MonkeyJumpReception.Object.CFrame until EntrancePortal.Portal.Locked.Visible ~= true
- repeat task.wait() HumanoidRootPart.CFrame = EntrancePortal.Zone.CFrame until Player:GetAttribute("BeingChased") ~= true
- getgenv().ReturnedToPort = true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement