Advertisement
Honansik

Heroes Awakening Auto Farm Bank Script

Sep 7th, 2023 (edited)
1,655
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.61 KB | None | 0 0
  1. repeat task.wait() until game:IsLoaded()
  2.  
  3. SendWebhook = true
  4. Webhook = ""
  5.  
  6. local Workspace = game:GetService("Workspace")
  7. local Map =  Workspace.Map
  8. local AreasOfImportance = Map.AreasOfImportance
  9. local Bank = AreasOfImportance.Bank
  10. local CashStacks = Bank.CashStacks
  11. local Players = game:GetService("Players")
  12. local Player = Players.LocalPlayer
  13. local Character = Player.Character
  14. local Humanoid = Character:WaitForChild("Humanoid")
  15. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  16. local PlayerData = ReplicatedStorage:FindFirstChild("AllPlayerData")
  17.  
  18. local function fireproximityprompt(Obj, Amount, Skip)
  19.     if Obj.ClassName == "ProximityPrompt" then
  20.         Amount = Amount or 1
  21.         local PromptTime = Obj.HoldDuration
  22.         if Skip then
  23.             Obj.HoldDuration = 0
  24.         end
  25.         for i = 1, Amount do
  26.             Obj:InputHoldBegin()
  27.             if not Skip then
  28.                 wait(Obj.HoldDuration)
  29.             end
  30.             Obj:InputHoldEnd()
  31.         end
  32.         Obj.HoldDuration = PromptTime
  33.     else
  34.         error("userdata<ProximityPrompt> expected")
  35.     end
  36. end
  37.  
  38. local PlaceID = game.PlaceId
  39. local AllIDs = {}
  40. local foundAnything = ""
  41. local actualHour = os.date("!*t").hour
  42. local Deleted = false
  43. local File = pcall(function()
  44.     AllIDs = game:GetService('HttpService'):JSONDecode(readfile("NotSameServers.json"))
  45. end)
  46. if not File then
  47.     table.insert(AllIDs, actualHour)
  48.     writefile("NotSameServers.json", game:GetService('HttpService'):JSONEncode(AllIDs))
  49. end
  50. function TPReturner()
  51.     local Site;
  52.     if foundAnything == "" then
  53.         Site = game.HttpService:JSONDecode(game:HttpGet('https://games.roblox.com/v1/games/' .. PlaceID .. '/servers/Public?sortOrder=Asc&limit=100'))
  54.     else
  55.         Site = game.HttpService:JSONDecode(game:HttpGet('https://games.roblox.com/v1/games/' .. PlaceID .. '/servers/Public?sortOrder=Asc&limit=100&cursor=' .. foundAnything))
  56.     end
  57.     local ID = ""
  58.     if Site.nextPageCursor and Site.nextPageCursor ~= "null" and Site.nextPageCursor ~= nil then
  59.         foundAnything = Site.nextPageCursor
  60.     end
  61.     local num = 0;
  62.     for i,v in pairs(Site.data) do
  63.         local Possible = true
  64.         ID = tostring(v.id)
  65.         if tonumber(v.maxPlayers) > tonumber(v.playing) then
  66.             for _,Existing in pairs(AllIDs) do
  67.                 if num ~= 0 then
  68.                     if ID == tostring(Existing) then
  69.                         Possible = false
  70.                     end
  71.                 else
  72.                     if tonumber(actualHour) ~= tonumber(Existing) then
  73.                         local delFile = pcall(function()
  74.                             delfile("NotSameServers.json")
  75.                             AllIDs = {}
  76.                             table.insert(AllIDs, actualHour)
  77.                         end)
  78.                     end
  79.                 end
  80.                 num = num + 1
  81.             end
  82.             if Possible == true then
  83.                 table.insert(AllIDs, ID)
  84.                 wait()
  85.                 pcall(function()
  86.                     writefile("NotSameServers.json", game:GetService('HttpService'):JSONEncode(AllIDs))
  87.                     wait()
  88.                     game:GetService("TeleportService"):TeleportToPlaceInstance(PlaceID, ID, game.Players.LocalPlayer)
  89.                 end)
  90.                 wait(4)
  91.             end
  92.         end
  93.     end
  94. end
  95.  
  96. function Teleport()
  97.     while wait() do
  98.         pcall(function()
  99.             TPReturner()
  100.             if foundAnything ~= "" then
  101.                 TPReturner()
  102.             end
  103.         end)
  104.     end
  105. end
  106.  
  107. local function SendInfo()
  108.     local url = Webhook
  109.     local data = {
  110.         ["embeds"] = {
  111.             {
  112.                 ["title"] = "Stat Update",
  113.                 ["description"] = "Username: ||" .. game.Players.LocalPlayer.Name .. "||",
  114.                 ["type"] = "rich",
  115.                 ["color"] = tonumber(0x7269da),
  116.             }
  117.         }
  118.     }
  119.  
  120.     data.embeds[1].description = data.embeds[1].description .. "\nLevel: " .. PlayerData[Player.Name]["Char Data"].ActualLevel.Value
  121.     data.embeds[1].description = data.embeds[1].description .. "\nCash: " .. PlayerData[Player.Name]["Char Data"].Cash.Value
  122.     data.embeds[1].description = data.embeds[1].description .. "\nStat Points: " .. PlayerData[Player.Name]["Char Data"].StatPoints.Value
  123.  
  124.     local newdata = game:GetService("HttpService"):JSONEncode(data)
  125.  
  126.     local headers = {
  127.         ["content-type"] = "application/json"
  128.     }
  129.  
  130.     local request = http_request or request or HttpPost or syn.request
  131.     local abcdef = {Url = url, Body = newdata, Method = "POST", Headers = headers}
  132.     request(abcdef)
  133. end
  134.  
  135.  
  136. while task.wait() do
  137. local function isCashStacksEmpty()
  138.     local cashStacks = CashStacks:GetChildren()
  139.     return #cashStacks == 0
  140. end
  141.  
  142. if game:GetService("Workspace").Values.BankRobbed.Value == true then
  143.     if isCashStacksEmpty() then
  144.         if SendWebhook == true then
  145.         SendInfo()
  146.         else
  147.         task.wait(0.2)
  148.         Teleport()
  149.         task.wait(15)
  150.         end
  151.     else
  152.         for i, v in pairs(CashStacks:GetDescendants()) do
  153.             if v.ClassName == "ProximityPrompt" then
  154.                 Character:SetPrimaryPartCFrame(CFrame.new(v.Parent.Position))
  155.                 fireproximityprompt(v, 1, true)
  156.             end
  157.         end
  158.     end
  159.     elseif game:GetService("Workspace").Values.BankRobbed.Value == false then
  160.         Character:SetPrimaryPartCFrame(CFrame.new(Bank.BankDoor.Position) * CFrame.new(0, 0, 2))
  161.         task.wait(0.1)
  162.         fireproximityprompt(Bank.BankDoor.ProximityPrompt, 1, true)
  163.     end
  164. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement