Advertisement
Guest User

Untitled

a guest
Jan 18th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.12 KB | None | 0 0
  1. local total = 1
  2. local status = 2
  3. local wait_time = 0
  4.  
  5. local get_loot_box = function()
  6.     EchoConsole("Get box " .. tostring(total))
  7.    
  8.     local loot_interface = Managers.backend:get_interface("loot")
  9.     loot_interface:generate_end_of_level_loot(true, true, "hardest", "catacombs", 3, 4, 2, "bright_wizard", 312050, 313370, nil, nil)
  10.    
  11.     total = total + 1
  12. end
  13.  
  14. Mods.hook.set("", "BackendInterfaceLootPlayfab.end_of_level_loot_request_cb", function(func, self, id, result)
  15.     func(self, id, result)
  16.    
  17.     status = 2
  18. end)
  19.  
  20. Mods.hook.set("", "MatchmakingManager.update", function(func, self, dt, t)
  21.     safe_pcall(function()
  22.         if status == 0 then
  23.             if total < 100 then
  24.                 get_loot_box()
  25.                
  26.                 status = 1
  27.             else
  28.                 Mods.exec("loadfile", "chest_open")
  29.             end
  30.         elseif status == 2 then
  31.             wait_time = t
  32.             status = 3
  33.         elseif status == 3 then
  34.             if wait_time + 1 < t then
  35.                 status = 0
  36.             end
  37.         end
  38.     end)
  39.    
  40.     return func(self, dt, t)
  41. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement