Advertisement
DeezBigNuts

Hunted

Jun 29th, 2025 (edited)
517
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 14.57 KB | None | 0 0
  1. -------------------->> Execution Check <<--------------------
  2.  
  3. local Places = {
  4.     [136431686349723] = "lobby";
  5.     [102181577519757] = "monkeybusiness";
  6. }
  7.  
  8. local scriptLinks = {
  9.     [136431686349723] = "https://pastebin.com/raw/93h9PUk2";
  10.     [102181577519757] = "https://pastebin.com/raw/93h9PUk2";
  11. }
  12.  
  13. local function getScriptLink()
  14.     return scriptLinks[game.PlaceId]
  15. end
  16.  
  17. if Places[game.PlaceId] == nil then print("GigaHub: unsupported game!") return else print(Places[game.PlaceId]) end
  18. if getgenv().Ran == true then print("GigaHub: script already got ran!") return end
  19. getgenv().Ran = true
  20.  
  21. -------------------->> Loading Starts <<--------------------
  22.  
  23. local LoadingTime = DateTime.now().UnixTimestamp
  24. print("-------------------->> Loading GigaHub: Hunted Auto Win <<--------------------")
  25. print("Loading Start Time: 0")
  26. repeat task.wait() until game:IsLoaded()
  27.  
  28. -------------------->> Services <<--------------------
  29.  
  30. local cloneref = cloneref or function (...)
  31.     return ...
  32. end
  33.  
  34. local Services = setmetatable({}, {
  35.     __index = function(self, service)
  36.         return cloneref(game:FindService(service)) or cloneref(game:GetService(service)) or cloneref(game:service(service))
  37.     end
  38. })
  39.  
  40. local Players           = Services.Players
  41. local WorkSpace         = Services.Workspace
  42. local ReplicatedStorage = Services.ReplicatedStorage
  43.  
  44. -------------------->> Variables <<--------------------
  45.  
  46. local Player    = Players.LocalPlayer
  47. local PlayerGui = Player.PlayerGui
  48.  
  49. local Bridges = ReplicatedStorage:WaitForChild("Bridges")
  50.  
  51. local Components    = ReplicatedStorage:WaitForChild("Components")
  52. local Notifications = require(Components:WaitForChild("Notifications"))
  53.  
  54. -------------------->> Functions <<--------------------
  55.  
  56. local function GetHumanoid()
  57.     local Character = Player.Character
  58.     local Humanoid = Character:FindFirstChild("Humanoid")
  59.  
  60.     if Humanoid ~= nil and Humanoid.Health > 0 then
  61.         return Character.Humanoid
  62.     end
  63. end
  64.  
  65. -- local function GetLastCFrame()
  66. --     local Character = Player.Character
  67. --     local Humanoid = GetHumanoid()
  68.  
  69. --     if Humanoid ~= nil and Humanoid.Health > 0 then
  70. --         return Character.HumanoidRootPart.CFrame
  71. --     end
  72. -- end
  73.  
  74. local function GetHumanoidRootPart()
  75.     local Character = Player.Character
  76.     local Humanoid = GetHumanoid()
  77.  
  78.     if Humanoid ~= nil and Humanoid.Health > 0 then
  79.         return Character.HumanoidRootPart
  80.     end
  81. end
  82.  
  83. local function getAttribute(checkObject:Instance, attribute: string, lowerString: boolean)
  84.     if typeof(checkObject) ~= "Instance" or typeof(attribute) ~= "string" then return end
  85.     local value = checkObject:GetAttribute(attribute)
  86.  
  87.     if typeof(value) == "string" and lowerString == true then
  88.         return string.lower(value)
  89.     end
  90.  
  91.     return value
  92. end
  93.  
  94. local function setAttribute(checkObject:Instance, attribute: string, value: any)
  95.     if typeof(checkObject) ~= "Instance" or typeof(attribute) ~= "string" then return end
  96.     checkObject:SetAttribute(attribute, value)
  97. end
  98.  
  99. local function queueScriptCheck(notificationFunction)
  100.     if typeof(queue_on_teleport) ~= "function" then
  101.         notificationFunction({Text = ("%s doesn't support 'queue_on_teleport'!"):format(identifyexecutor() or "Your executor"); Duration = 5;})
  102.         notificationFunction({Text = "Make sure you put this script in the 'AutoExecute' folder! (If you have it)"; Duration = 5;})
  103.         task.wait(5)
  104.     elseif typeof(queue_on_teleport) == "function" then
  105.         if getScriptLink() ~= nil then
  106.             notificationFunction({Text = "Queued script for auto load on teleport."; Duration = 5;})
  107.             queue_on_teleport(('loadstring(game:HttpGet("%s", true))()'):format(getScriptLink()))
  108.             task.wait(5)
  109.         end
  110.     end
  111. end
  112.  
  113. -------------------->> Main <<--------------------
  114.  
  115. print("Loading End Time: "..tostring(DateTime.now().UnixTimestamp - LoadingTime))
  116.  
  117. if Places[game.PlaceId] == "lobby" then
  118.     --getgenv().Portal = getgenv().Portal or "MonkeyBusiness" future
  119.     getgenv().Difficulty = getgenv().Difficulty or "Hard" -- Easy, Normal, Hard
  120.    
  121.     -------------------->> local variables <<--------------------
  122.     local lobbyRemote = Bridges:FindFirstChild("Lobby")
  123.  
  124.     -------------------->> local functions <<--------------------
  125.     local function getBindableFunction(callBack: (buttonName: string) -> ())
  126.         local bind
  127.  
  128.         if Bridges:FindFirstChild("GigaHub-BindableFunction") == nil then
  129.             bind = Instance.new("BindableFunction", Bridges)
  130.             bind.Name = "GigaHub-BindableFunction"
  131.         else
  132.             bind = Bridges:FindFirstChild("GigaHub-BindableFunction")
  133.         end
  134.  
  135.         if typeof(callBack) == "function" then
  136.             bind.OnInvoke = function(buttonName: string)
  137.                 callBack(buttonName)
  138.                 bind:Destroy()
  139.             end
  140.         end
  141.  
  142.         return bind
  143.     end
  144.  
  145.     local function notification(
  146.         arg:{
  147.             Title: string;
  148.             Text: string;
  149.             Duration: number;
  150.             Callback: BindableFunction;
  151.             Button1: string;
  152.             Button2: string;
  153.         })
  154.         Services.StarterGui:SetCore("SendNotification", {
  155.             Title    = arg.Title or "[GigaHub]:";
  156.             Text     = arg.Text or "PlaceHolder.";
  157.             Duration = arg.Duration or 5;
  158.             Callback = arg.Callback or getBindableFunction(function(buttonName) print(buttonName) end);
  159.             Button1  = arg.Button1 or nil;
  160.             Button2  = arg.Button2 or nil;
  161.         })
  162.     end
  163.  
  164.     -------------------->> local main <<--------------------
  165.     queueScriptCheck(notification)
  166.  
  167.     if lobbyRemote == nil then
  168.         notification({Text = "Lobby remote not found!"; Duration = math.huge;})
  169.         notification({Text = "Please rejoin!"; Duration = math.huge;})
  170.         return
  171.     end
  172.  
  173.     notification({Text = "Waiting for game to load!"})
  174.     repeat task.wait() until getAttribute(WorkSpace, "LoadingStopped") == true
  175.     local Queue = PlayerGui.Queue
  176.     local Difficulties = Queue.Difficulty.Banner
  177.  
  178.     notification({Text = "Searching for difficulty!"})
  179.     for i, v in pairs(Difficulties:GetChildren()) do
  180.         if string.lower(v.Name) == string.lower(getgenv().Difficulty) then
  181.             notification({Text = "Queuing Up!"})
  182.             while task.wait(0.5) do
  183.                 local trys = 0
  184.  
  185.                 local success, result = pcall(function()
  186.                     lobbyRemote:FireServer("Teleport", getgenv().Difficulty)
  187.                 end)
  188.  
  189.                 if success ~= true then
  190.                     trys += 1
  191.                     if trys > 5 then notification({Text = "Teleport failed, rejoin! 5/5"}) break end
  192.                     notification({Text = ("Error occured, retrying! %/5"):format(trys)})
  193.                 end
  194.             end
  195.             return
  196.         end
  197.     end
  198.  
  199.     notification({Text = ("Did not find difficulty: '%s'!"):format(getgenv().Difficulty); Duration = math.huge;})
  200.     notification({Text = "Please put a valid difficulty & rejoin!"; Duration = math.huge;})
  201.  
  202. --[[ for future updates to the lobby
  203.     local Hallways = WorkSpace.Hallways
  204.     local Queue = PlayerGui.Queue
  205.     local Difficulties = Queue.Difficulty.Banner
  206.     local Gamemodes = Queue.Gamemodes.Banner
  207.  
  208.     -- for future updates to the lobby
  209.     if Gamemodes.Parent.Visible ~= true then
  210.         if Hallways:FindFirstChild(getgenv().Portal) ~= nil then
  211.             local Portal = Hallways:FindFirstChild(getgenv().Portal)
  212.             if Portal:FindFirstChild("Zone") ~= nil then
  213.                 HumanoidRootPart.CFrame = Portal.Zone.CFrame
  214.                 repeat task.wait() until Gamemodes.Parent.Visible == true
  215.             end
  216.         end
  217.     end
  218.  
  219.  
  220.     for i, v in pairs(Gamemodes:GetChildren()) do
  221.         if string.lower(v.Name) == "singleplayer" then
  222.             firesignal(v.Activated)
  223.             repeat task.wait() until Gamemodes.Parent.Visible ~= true
  224.             break
  225.         end
  226.     end
  227.  
  228.     for i, v in pairs(Difficulties:GetChildren()) do
  229.         if string.lower(v.Name) == string.lower(getgenv().Difficulty) then
  230.             while task.wait(0.5) do
  231.                 firesignal(v.Activated)
  232.             end
  233.         end
  234.     end
  235. ]]
  236. elseif Places[game.PlaceId] == "monkeybusiness" then
  237.     local function notification(
  238.         arg:{
  239.             Title: string;
  240.             Text: string;
  241.             Duration: number;
  242.         })
  243.         Notifications:SendNotification({
  244.             Title    = arg.Title or "[GigaHub]:";
  245.             Text     = arg.Text or "PlaceHolder.";
  246.             Duration = arg.Duration or 5;
  247.         })
  248.     end
  249.  
  250.     -------------------->> local variables <<--------------------
  251.     queueScriptCheck(notification)
  252.     notification({Text = "Loading Auto Win!"})
  253.  
  254.     local HumanoidRootPart = GetHumanoidRootPart()
  255.     if HumanoidRootPart == nil then repeat HumanoidRootPart = GetHumanoidRootPart() until HumanoidRootPart ~= nil end
  256.  
  257.     local NotificationStack = PlayerGui:WaitForChild("Notifications"):WaitForChild("NotificationStack")
  258.  
  259.     local Shards = WorkSpace:WaitForChild("Shards")
  260.     local Hotel = WorkSpace:WaitForChild("Hotel")
  261.     local Portals = WorkSpace:WaitForChild("Portals")
  262.  
  263.     local EntrancePortal = Portals.EntrancePortal
  264.  
  265.     local Elevator = Hotel.Elevator
  266.     local InsideElevator = Elevator.ElevatorInside
  267.  
  268.     if getAttribute(WorkSpace, "GameStarted") == nil then
  269.         notification({Text = "Teleporting to Elevator!"})
  270.         HumanoidRootPart.CFrame = InsideElevator.CFrame
  271.     end
  272.  
  273.     repeat task.wait() until Hotel:FindFirstChild("Maze") ~= nil
  274.  
  275.     -------------------->> local variables Part 2 <<--------------------
  276.     local Maze = Hotel.Maze
  277.     local Interactable = Maze.Interactable
  278.     local RingAltarModel = Maze.Rooms.Main.RingAltar
  279.     local RingAltar = RingAltarModel.Parts.RingAltar
  280.  
  281.     -------------------->> local functions <<--------------------
  282.  
  283.     local function getClosestShard(objects: {any}, objectRef: Instance)
  284.         local closestShard = nil
  285.         local shortestDistance = math.huge
  286.  
  287.         for _, object in ipairs(objects) do
  288.             if object:IsA("BasePart") then
  289.                 local distance = (object.Position - objectRef.Position).Magnitude
  290.                 if distance < shortestDistance then
  291.                     shortestDistance = distance
  292.                     closestShard = object
  293.                 end
  294.             end
  295.         end
  296.  
  297.         return closestShard
  298.     end
  299.  
  300.     local function notifyCurrentQuest(quest: string)
  301.         notification({Text = ("Waiting for current quest: %s!"):format(quest or getAttribute(WorkSpace, "CurrentQuest"))})
  302.     end
  303.  
  304.     local function printCurrentQuest(quest: string)
  305.         print(("Waiting for current quest: %s!"):format(quest or getAttribute(WorkSpace, "CurrentQuest")))
  306.     end
  307.  
  308.     local function getCurrentQuest(lowerString: boolean)
  309.         return getAttribute(WorkSpace, "CurrentQuest", lowerString)
  310.     end
  311.  
  312.     local function interactWithRingAltar()
  313.         if RingAltarModel:FindFirstChild("Interact") ~= nil then
  314.             if RingAltarModel.Interact:FindFirstChildOfClass("RemoteEvent") ~= nil then
  315.                 RingAltarModel.Interact:FindFirstChildOfClass("RemoteEvent"):FireServer()
  316.             end
  317.         end
  318.     end
  319.  
  320.     -------------------->> auto win <<--------------------
  321.     if getAttribute(WorkSpace, "GameStarted") == nil then
  322.         notification({Text = "Teleporting to RingAltar!"})
  323.         HumanoidRootPart.CFrame = RingAltar.CFrame
  324.     end
  325.  
  326.     if WorkSpace:GetAttribute("Skipped") == nil then
  327.         local Button:TextButton = nil
  328.         for i, v in pairs(NotificationStack:GetChildren()) do
  329.             if v:IsA("Frame") and v:FindFirstChild("Buttons") ~= nil then
  330.                 if v.Buttons:FindFirstChild("Button1_Clone") == nil then continue end
  331.                 Button = v.Buttons.Button1_Clone
  332.                 firesignal(Button.MouseButton1Click)
  333.                 notification({Text = "Skipping Tutorial!"})
  334.             end
  335.         end
  336.  
  337.         if Button == nil then
  338.             local Connection
  339.             Connection = NotificationStack.ChildAdded:Connect(function(Child:Frame)
  340.                 if Child:IsA("Frame") and Child:FindFirstChild("Buttons") ~= nil then
  341.                     if Child.Buttons:FindFirstChild("Button1_Clone") == nil then return end
  342.                     Button = Child.Buttons.Button1_Clone
  343.                     firesignal(Button.MouseButton1Click)
  344.                     notification({Text = "Skipping Tutorial!"})
  345.                     Connection:Disconnect()
  346.                     Connection = nil
  347.                 end
  348.             end)
  349.         end
  350.     end
  351.  
  352.     notification({Text = "Waiting for game to start!"})
  353.     repeat print("Waiting for game to start") task.wait() until getAttribute(WorkSpace, "GameStarted") == true
  354.     repeat task.wait() until getAttribute(WorkSpace, "CurrentQuest") ~= nil
  355.     notifyCurrentQuest("BREAK THE BOARDS")
  356.     repeat task.wait() printCurrentQuest("BREAK THE BOARDS") until getCurrentQuest(true) == "break the boards"
  357.  
  358.     notification({Text = "Breaking the boards!"})
  359.     for _, v in pairs(Interactable:GetDescendants()) do
  360.         if v.Name == "Interact" and v:FindFirstChildOfClass("RemoteEvent") ~= nil then
  361.             v:FindFirstChildOfClass("RemoteEvent"):FireServer()
  362.         end
  363.     end
  364.  
  365.     task.wait(4)
  366.  
  367.     -- notification({Text = "Attempting to trigger next quest!"})
  368.     -- for i = 1, 20 do
  369.     --  if getCurrentQuest(true) == "collect all shards" then break end
  370.     --  task.wait(1)
  371.     --  local closest = getClosestShard(Shards:GetChildren(), RingAltar)
  372.     --  HumanoidRootPart.CFrame = closest.CFrame
  373.     -- end
  374.  
  375.     -- notifyCurrentQuest("COLLECT ALL SHARDS")
  376.     -- repeat task.wait() printCurrentQuest("COLLECT ALL SHARDS") until getCurrentQuest(true) == "collect all shards"
  377.  
  378.     notification({Text = "Collecting all shards..."})
  379.     for _, v in pairs(Shards:GetChildren()) do
  380.         if v:FindFirstChild("TouchInterest") ~= nil then
  381.             firetouchinterest(HumanoidRootPart, v, 0)
  382.             firetouchinterest(HumanoidRootPart, v, 1)
  383.         end
  384.     end
  385.  
  386.     notifyCurrentQuest("GET BACK TO THE RING ALTAR")
  387.     repeat task.wait() printCurrentQuest("GET BACK TO THE RING ALTAR") until getCurrentQuest(true) == "get back to the ring altar"
  388.  
  389.     notification({Text = "Teleporting to RingAltar..."})
  390.     for i = 1, 5 do
  391.         HumanoidRootPart.CFrame = RingAltar.CFrame
  392.         task.wait(0.4)
  393.     end
  394.  
  395.     notifyCurrentQuest("RETURN TO THE PORTAL")
  396.     repeat
  397.         task.wait()
  398.         interactWithRingAltar()
  399.  
  400.         if getAttribute(WorkSpace, "RingPieceCollected") ~= true then
  401.             interactWithRingAltar()
  402.             RingAltar.Attachment:Destroy()
  403.             setAttribute(WorkSpace, "RingPieceCollected", true)
  404.         end
  405.         printCurrentQuest("RETURN TO THE PORTAL")
  406.     until getCurrentQuest(true) == "return to the portal"
  407.     notification({Text = "Teleporting to Elevator..."})
  408.     repeat task.wait() HumanoidRootPart.CFrame = InsideElevator.CFrame until Hotel:FindFirstChild("Entrance") ~= nil and (HumanoidRootPart.Position - Hotel.Entrance.Lobby.MiddleCarpet.Position).Magnitude <= 120
  409.     --repeat task.wait() HumanoidRootPart.CFrame = Hotel.Events.MonkeysSpawn.Object.CFrame until #WorkSpace.Terrain.Enemies:GetChildren() > 2
  410.     --repeat task.wait() until Hotel.Events:FindFirstChild("MonkeyJumpReception") ~= nil
  411.     notification({Text = "Teleporting to Reception..."})
  412.     repeat task.wait() HumanoidRootPart.CFrame = Hotel.Events.MonkeyJumpReception.Object.CFrame until EntrancePortal.Portal.Locked.Visible ~= true
  413.     notification({Text = "Teleporting to Portal..."})
  414.     repeat task.wait() HumanoidRootPart.CFrame = EntrancePortal.Zone.CFrame until PlayerGui.Escape.InitialPopup.BackgroundTransparency == 0 -- or getAttribute(Player, "BeingChased") ~= true
  415.     notification({Text = ("ESCAPED!!! Difficulty: %s"):format(getAttribute(WorkSpace, "Difficulty")); Duration = 30;})
  416. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement