Marty2000

[DOORS] Rooms auto complete script

Apr 15th, 2024
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.62 KB | Cybersecurity | 0 0
  1. -- Made by geodude#2619
  2. -- Thanks lolcat, kardin!
  3.  
  4. if game.PlaceId ~= 6839171747 or game.ReplicatedStorage.GameData.Floor.Value ~= "Rooms" then
  5.     game.StarterGui:SetCore("SendNotification", { Title = "Invalid Place"; Text = "The game detected appears to not be rooms. Please execute this while in rooms!" })
  6.    
  7.     local Sound = Instance.new("Sound")
  8.     Sound.Parent = game.SoundService
  9.     Sound.SoundId = "rbxassetid://550209561"
  10.     Sound.Volume = 5
  11.     Sound.PlayOnRemove = true
  12.     Sound:Destroy()
  13.    
  14.     return
  15. elseif workspace:FindFirstChild("PathFindPartsFolder") then
  16.     game.StarterGui:SetCore("SendNotification", { Title = "Warning"; Text = "If you are having issues and the bot is broken, please contact me! geodude#2619" })
  17.    
  18.     local Sound = Instance.new("Sound")
  19.     Sound.Parent = game.SoundService
  20.     Sound.SoundId = "rbxassetid://550209561"
  21.     Sound.Volume = 5
  22.     Sound.PlayOnRemove = true
  23.     Sound:Destroy()
  24.  
  25.     return
  26. end
  27.  
  28. local PathfindingService = game:GetService("PathfindingService")
  29. local VirtualInputManager = game:GetService('VirtualInputManager')
  30. local LocalPlayer = game.Players.LocalPlayer
  31. local LatestRoom = game.ReplicatedStorage.GameData.LatestRoom
  32.  
  33. local Cooldown = false
  34.  
  35. local ScreenGui = Instance.new("ScreenGui")
  36. ScreenGui.Parent = game.CoreGui
  37.  
  38. local TextLabel = Instance.new("TextLabel")
  39. TextLabel.Parent = ScreenGui
  40.  
  41. TextLabel.Size = UDim2.new(0,350,0,100)
  42. TextLabel.TextSize = 48
  43. TextLabel.TextStrokeColor3 = Color3.new(1,1,1)
  44. TextLabel.TextStrokeTransparency = 0
  45. TextLabel.BackgroundTransparency = 1
  46.  
  47. local GC = getconnections or get_signal_cons
  48. if GC then
  49.     for i,v in pairs(GC(LocalPlayer.Idled)) do
  50.         if v["Disable"] then
  51.             v["Disable"](v)
  52.         elseif v["Disconnect"] then
  53.             v["Disconnect"](v)
  54.         end
  55.     end
  56. end
  57.  
  58. local Folder = Instance.new("Folder")
  59. Folder.Parent = workspace
  60. Folder.Name = "PathFindPartsFolder"
  61.  
  62. if LocalPlayer.PlayerGui.MainUI.Initiator.Main_Game.RemoteListener.Modules:FindFirstChild("A90") then
  63.     LocalPlayer.PlayerGui.MainUI.Initiator.Main_Game.RemoteListener.Modules.A90:Destroy() -- Fuck you A90
  64. end
  65.  
  66. function getLocker()
  67.     local Closest
  68.  
  69.     for i,v in pairs(workspace.CurrentRooms:GetDescendants()) do
  70.         if v.Name == "Rooms_Locker" then
  71.             if v:FindFirstChild("Door") and v:FindFirstChild("HiddenPlayer") then
  72.                 if v.HiddenPlayer.Value == nil then
  73.                     if v.Door.Position.Y > -3 then -- Prevents going to the lower lockers in the room with the bridge
  74.                         if Closest == nil then
  75.                             Closest = v.Door
  76.                         else
  77.                             if (LocalPlayer.Character.HumanoidRootPart.Position - v.Door.Position).Magnitude < (Closest.Position - LocalPlayer.Character.HumanoidRootPart.Position).Magnitude then
  78.                                 Closest = v.Door
  79.                             end
  80.                         end
  81.                     end
  82.                 end
  83.             end
  84.         end
  85.     end
  86.     return Closest
  87. end
  88.  
  89. function getPath()
  90.     local Part
  91.    
  92.     local Entity = workspace:FindFirstChild("A60") or workspace:FindFirstChild("A120")
  93.     if Entity and Entity.Main.Position.Y > -2 then
  94.         Part = getLocker()
  95.     else
  96.         Part = workspace.CurrentRooms[LatestRoom.Value].Door.Door
  97.     end
  98.     return Part
  99. end
  100.  
  101. LatestRoom:GetPropertyChangedSignal("Value"):Connect(function()
  102.     TextLabel.Text = "Room: "..math.clamp(LatestRoom.Value, 1,1000)
  103.  
  104.     if LatestRoom.Value ~= 1000 then
  105.         LocalPlayer.DevComputerMovementMode = Enum.DevComputerMovementMode.Scriptable
  106.     else
  107.         LocalPlayer.DevComputerMovementMode = Enum.DevComputerMovementMode.KeyboardMouse
  108.    
  109.         Folder:ClearAllChildren()
  110.    
  111.         local Sound = Instance.new("Sound")
  112.         Sound.Parent = game.SoundService
  113.         Sound.SoundId = "rbxassetid://4590662766"
  114.         Sound.Volume = 3
  115.         Sound.PlayOnRemove = true
  116.         Sound:Destroy()
  117.        
  118.         game.StarterGui:SetCore("SendNotification", { Title = "youtube.com/geoduude"; Text = "Thank you for using my script!" })
  119.         return
  120.     end
  121. end)
  122.  
  123. game:GetService("RunService").RenderStepped:connect(function()
  124.     LocalPlayer.Character.HumanoidRootPart.CanCollide = false
  125.     LocalPlayer.Character.Collision.CanCollide = false
  126.     LocalPlayer.Character.Collision.Size = Vector3.new(8,LocalPlayer.Character.Collision.Size.Y,8)
  127.  
  128.     LocalPlayer.Character.Humanoid.WalkSpeed = 21
  129.  
  130.     local Path = getPath()
  131.    
  132.     local Entity = workspace:FindFirstChild("A60") or workspace:FindFirstChild("A120")
  133.     if Entity then
  134.         if Path then
  135.             if Path.Parent.Name == "Rooms_Locker" then
  136.                 if Entity.Main.Position.Y > -2 then
  137.                     if (LocalPlayer.Character.HumanoidRootPart.Position - Path.Position).Magnitude < 2 then
  138.                         if LocalPlayer.Character.HumanoidRootPart.Anchored == false then
  139.                             fireproximityprompt(Path.Parent.HidePrompt)
  140.                         end
  141.                     end
  142.                 end
  143.             end
  144.         end
  145.         if Entity.Main.Position.Y < -2 then
  146.             if LocalPlayer.Character.HumanoidRootPart.Anchored == true then
  147.                 LocalPlayer.Character:SetAttribute("Hiding", false)
  148.             end
  149.         end
  150.     else
  151.         if LocalPlayer.Character.HumanoidRootPart.Anchored == true then
  152.             LocalPlayer.Character:SetAttribute("Hiding", false)
  153.         end
  154.     end
  155. end)
  156.  
  157. while true do
  158.  
  159.     task.wait()
  160.  
  161.     local Destination = getPath()
  162.  
  163.     local path = PathfindingService:CreatePath({ WaypointSpacing = 1, AgentRadius = 0.8, AgentCanJump = false })
  164.     path:ComputeAsync(LocalPlayer.Character.HumanoidRootPart.Position - Vector3.new(0,3,0), Destination.Position)
  165.     local Waypoints = path:GetWaypoints()
  166.  
  167.     if path.Status ~= Enum.PathStatus.NoPath then
  168.  
  169.         Folder:ClearAllChildren()
  170.  
  171.         for _, Waypoint in pairs(Waypoints) do
  172.             local part = Instance.new("Part")
  173.             part.Size = Vector3.new(1,1,1)
  174.             part.Position = Waypoint.Position
  175.             part.Shape = "Cylinder"
  176.             part.Rotation = Vector3.new(0,0,90)
  177.             part.Material = "SmoothPlastic"
  178.             part.Anchored = true
  179.             part.CanCollide = false
  180.             part.Parent = Folder
  181.         end
  182.  
  183.         for _, Waypoint in pairs(Waypoints) do
  184.             if LocalPlayer.Character.HumanoidRootPart.Anchored == false then
  185.                 LocalPlayer.Character.Humanoid:MoveTo(Waypoint.Position)
  186.                 LocalPlayer.Character.Humanoid.MoveToFinished:Wait()
  187.             end
  188.         end
  189.     end
  190. end
Add Comment
Please, Sign In to add comment