Advertisement
FilterYT

Untitled

Dec 16th, 2022 (edited)
137,573
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.80 KB | None | 0 0
  1. function thisCode()
  2. repeat task.wait() until game:IsLoaded()
  3. game:service'ReplicatedStorage'.Remotes.CommF_:InvokeServer("SetTeam","Pirates");
  4. local PlaceID = game.PlaceId
  5. local AllIDs = {}
  6. local foundAnything = ""
  7. local actualHour = os.date("!*t").hour
  8. local Deleted = false
  9. local File = pcall(function()
  10. AllIDs = game:GetService('HttpService'):JSONDecode(readfile("NotSameServers.json"))
  11. end)
  12. if not File then
  13. table.insert(AllIDs, actualHour)
  14. writefile("NotSameServers.json", game:GetService('HttpService'):JSONEncode(AllIDs))
  15. end
  16. function TPReturner()
  17. local Site;
  18. if foundAnything == "" then
  19. Site = game.HttpService:JSONDecode(game:HttpGet('https://games.roblox.com/v1/games/' .. PlaceID .. '/servers/Public?sortOrder=Asc&limit=100'))
  20. else
  21. Site = game.HttpService:JSONDecode(game:HttpGet('https://games.roblox.com/v1/games/' .. PlaceID .. '/servers/Public?sortOrder=Asc&limit=100&cursor=' .. foundAnything))
  22. end
  23. local ID = ""
  24. if Site.nextPageCursor and Site.nextPageCursor ~= "null" and Site.nextPageCursor ~= nil then
  25. foundAnything = Site.nextPageCursor
  26. end
  27. local num = 0;
  28. for i,v in pairs(Site.data) do
  29. local Possible = true
  30. ID = tostring(v.id)
  31. if tonumber(v.maxPlayers) > tonumber(v.playing) then
  32. for _,Existing in pairs(AllIDs) do
  33. if num ~= 0 then
  34. if ID == tostring(Existing) then
  35. Possible = false
  36. end
  37. else
  38. if tonumber(actualHour) ~= tonumber(Existing) then
  39. local delFile = pcall(function()
  40. delfile("NotSameServers.json")
  41. AllIDs = {}
  42. table.insert(AllIDs, actualHour)
  43. end)
  44. end
  45. end
  46. num = num + 1
  47. end
  48. if Possible == true then
  49. table.insert(AllIDs, ID)
  50. wait()
  51. pcall(function()
  52. writefile("NotSameServers.json", game:GetService('HttpService'):JSONEncode(AllIDs))
  53. wait()
  54. game:GetService("TeleportService"):TeleportToPlaceInstance(PlaceID, ID, game.Players.LocalPlayer)
  55. end)
  56. wait(4)
  57. end
  58. end
  59. end
  60. end
  61.  
  62. function Teleport()
  63. while wait() do
  64. pcall(function()
  65. TPReturner()
  66. if foundAnything ~= "" then
  67. TPReturner()
  68. end
  69. end)
  70. end
  71. end
  72. local veryImportantWaitTime = 0.5
  73. task.spawn(function()
  74. while task.wait(veryImportantWaitTime) do
  75. pcall(function()
  76. for i,v in pairs(game.CoreGui:GetDescendants()) do
  77. pcall(function()
  78. if string.find(v.Name,"ErrorMessage") then
  79. if string.find(v.Text,"Security kick") then
  80. veryImportantWaitTime = 1e9
  81. Teleport()
  82. end
  83. end
  84. end)
  85. end
  86. end)
  87. end
  88. end)
  89.  
  90. local AllowRunService = true
  91. local AllowRunServiceBind = Instance.new("BindableFunction")
  92. function AllowRunServiceBind.OnInvoke(args)
  93. if args == "Enable" then
  94. AllowRunService = true
  95. elseif args == "Disable" then
  96. AllowRunService = false
  97. end
  98. local CoreGui = game:GetService("StarterGui")
  99. CoreGui:SetCore("SendNotification", {
  100. Title = "ChestFarm",
  101. Text = "Enable/Disable ChestFarm",
  102. Duration = math.huge,
  103. Callback = AllowRunServiceBind,
  104. Button1 = "Enable",
  105. Button2 = "Disable",
  106. })
  107. end
  108.  
  109. local CoreGui = game:GetService("StarterGui")
  110. CoreGui:SetCore("SendNotification", {
  111. Title = "ChestFarm",
  112. Text = "Disable/Enable ChestFarm",
  113. Duration = math.huge,
  114. Callback = AllowRunServiceBind,
  115. Button1 = "Enable",
  116. Button2 = "Disable",
  117. })
  118.  
  119. task.spawn(function()
  120. while true do
  121. if AllowRunService == true then
  122. local hasChar = game.Players.LocalPlayer:FindFirstChild("Character")
  123. if not game.Players.LocalPlayer.Character then
  124.  
  125. else
  126. local hasCrewTag = game.Players.LocalPlayer.Character:FindFirstChild("CrewBBG",true)
  127. if hasCrewTag then hasCrewTag:Destroy() end
  128. local hasHumanoid = game.Players.LocalPlayer.Character:FindFirstChild("Humanoid")
  129. if hasHumanoid then
  130. local Chest = game.Workspace:FindFirstChild("Chest4") or game.Workspace:FindFirstChild("Chest3") or game.Workspace:FindFirstChild("Chest2") or game.Workspace:FindFirstChild("Chest1") or game.Workspace:FindFirstChild("Chest")
  131.  
  132. if Chest then
  133. game.Players.LocalPlayer.Character:PivotTo(Chest:GetPivot())
  134. firesignal(Chest.Touched,game.Players.LocalPlayer.Character.HumanoidRootPart)
  135. else
  136. Teleport()
  137. break
  138. end
  139. end
  140. end
  141. end
  142. task.wait()
  143. end
  144. end)
  145.  
  146. end
  147.  
  148. thisCode()
  149.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement