SHAD_vm

Auto Collect SPFS

Nov 17th, 2021 (edited)
481
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.28 KB | None | 0 0
  1. -- Super Power Fighting Simulator
  2. -- Auto Farm Halloween Token and Gems
  3. -- made by SHAD_vm#5041
  4.  
  5. --You can place this script in the autoexecute folder for afk/auto farming
  6.  
  7.  
  8.  
  9.  
  10. --//Settings//--
  11. _G.Enabled = true
  12. local TPTime = 5 -- Put whatever number you want there
  13. local ScriptLoadWaitTime = 6 -- DO NOT PUT IT LOWER THAN 5 OR IMA SLAP U
  14. --//Script//--
  15. local WaitForTheDamGui= game:WaitForChild("StarterGui")
  16. wait(ScriptLoadWaitTime)
  17.  
  18. local startergui = game:GetService("StarterGui")
  19. startergui:SetCore("SendNotification",{
  20.     Title = "WAIT";
  21.     Text = "Just sit back and watch. Make Sure to give the script a few seconds to work!";
  22.     Duration = 5;
  23. })
  24.  
  25. function AntiAfkIg()
  26.     local vu = game:GetService("VirtualUser")
  27.     game:GetService("Players").LocalPlayer.Idled:connect(function()
  28.         vu:Button2Down(Vector2.new(0,0),workspace.CurrentCamera.CFrame)
  29.         wait(1)
  30.         vu:Button2Up(Vector2.new(0,0),workspace.CurrentCamera.CFrame)
  31.     end)
  32. end
  33.  
  34.  
  35. local PlaceID = game.PlaceId
  36. local AllIDs = {}
  37. local foundAnything = ""
  38. local actualHour = os.date("!*t").hour
  39. local Deleted = false
  40. local File = pcall(function()
  41.     AllIDs = game:GetService('HttpService'):JSONDecode(readfile("ServersAlreadyJoined.json"))
  42. end)
  43. if not File then
  44.     table.insert(AllIDs, actualHour)
  45.     writefile("ServersAlreadyJoined.json", game:GetService('HttpService'):JSONEncode(AllIDs))
  46. end
  47. function TPStuffLol()
  48.     local Site;
  49.     if foundAnything == "" then
  50.         Site = game.HttpService:JSONDecode(game:HttpGet('https://games.roblox.com/v1/games/' .. PlaceID .. '/servers/Public?sortOrder=Asc&limit=100'))
  51.     else
  52.         Site = game.HttpService:JSONDecode(game:HttpGet('https://games.roblox.com/v1/games/' .. PlaceID .. '/servers/Public?sortOrder=Asc&limit=100&cursor=' .. foundAnything))
  53.     end
  54.     local ID = ""
  55.     if Site.nextPageCursor and Site.nextPageCursor ~= "null" and Site.nextPageCursor ~= nil then
  56.         foundAnything = Site.nextPageCursor
  57.     end
  58.     local num = 0;
  59.     for i,v in pairs(Site.data) do
  60.         local Possible = true
  61.         ID = tostring(v.id)
  62.         if tonumber(v.maxPlayers) > tonumber(v.playing) then
  63.             for _,Existing in pairs(AllIDs) do
  64.                 if num ~= 0 then
  65.                     if ID == tostring(Existing) then
  66.                         Possible = false
  67.                     end
  68.                 else
  69.                     if tonumber(actualHour) ~= tonumber(Existing) then
  70.                         local delFile = pcall(function()
  71.                             delfile("ServersAlreadyJoined.json")
  72.                             AllIDs = {}
  73.                             table.insert(AllIDs, actualHour)
  74.                         end)
  75.                     end
  76.                 end
  77.                 num = num + 1
  78.             end
  79.             if Possible == true then
  80.                 table.insert(AllIDs, ID)
  81.                 wait()
  82.                 pcall(function()
  83.                     writefile("ServersAlreadyJoined.json", game:GetService('HttpService'):JSONEncode(AllIDs))
  84.                     wait()
  85.                     game:GetService("TeleportService"):TeleportToPlaceInstance(PlaceID, ID, game.Players.LocalPlayer)
  86.                 end)
  87.                 wait(4)
  88.             end
  89.         end
  90.     end
  91. end
  92.  
  93. function Teleport()
  94.     while wait() do
  95.         pcall(function()
  96.             TPStuffLol()
  97.             if foundAnything ~= "" then
  98.                 TPStuffLol()
  99.             end
  100.         end)
  101.     end
  102. end
  103.  
  104.  
  105. function TPAuto()
  106.     wait(TPTime)
  107.     Teleport()
  108. end
  109.  
  110. if _G.Enabled == true then
  111.     AntiAfkIg()
  112.     while wait() do
  113.  
  114. for i,o_B in pairs(Workspace.EvilPumpkins:GetChildren()) do
  115. fireclickdetector(o_B.ClickDetector)
  116. end wait()
  117. for i,o_X in pairs(Workspace.MiniChests:GetChildren()) do
  118. fireclickdetector(o_X.ClickDetector)
  119. end
  120.  
  121.         TPAuto()
  122.     end
  123. end
  124.  
Add Comment
Please, Sign In to add comment