Quangdunght1

Welcome to Bloxburg [BETA]

Jul 28th, 2019
1,365
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --[[
  2. hi epic gamers
  3. this best free bloxburg hack by lewluw (Luaa#0381)
  4. it also does not hook _namecall wOAh so u no ban ban
  5.  
  6. big credits to wally for his sexy ui lib <3
  7. ]]
  8.  
  9. -- Variables
  10. local library = loadstring(game:HttpGet("https://pastebin.com/raw/7Z6TzFnv", true))(); -- Credits to wally (https://v3rmillion.net/member.php?action=profile&uid=359615)
  11. local player = game:GetService("Players").LocalPlayer;
  12. local virtualUser = game:GetService("VirtualUser");
  13. local client = {};
  14. local currentJob = nil;
  15. local currentWorkstation = nil;
  16. local workEvent = nil;
  17. local supportedJobs = {
  18. ["BloxyBurgersCashier"] = true,
  19. ["StylezHairdresser"] = true
  20. };
  21. local isActive = false;
  22. local completedOrders = 0;
  23. local completedOrdersText = nil;
  24. local shiftEarningsText = nil;
  25.  
  26. -- Get the needed upvalues from the registry.
  27. local function getClient()
  28. local clientUpvalues = {
  29. 'modules'
  30. }
  31.  
  32. for _,v in next, debug.getregistry() do
  33. if(type(v) == "function") then
  34. local upvalues = debug.getupvalues(v);
  35.  
  36. for i,v in next, clientUpvalues do
  37. if(upvalues[v] ~= nil and client[v] == nil) then
  38. client[v] = upvalues[v];
  39. end
  40. end
  41. end
  42. end
  43. end
  44.  
  45. -- Is supported job?
  46. local function isSupported()
  47. return (supportedJobs[currentJob] or false);
  48. end
  49.  
  50. -- Is workstation free?
  51. local function isWorkstationFree(workstation)
  52. return ((workstation:FindFirstChild("InUse").Value == player or not workstation:FindFirstChild("InUse").Value) and true or false);
  53. end
  54.  
  55. -- Is workstation occupied?
  56. local function isWorkstationOccupied(workstation)
  57. return (workstation:FindFirstChild("Occupied").Value and true or false)
  58. end
  59.  
  60. -- Grab order from workstation.
  61. local function getOrder(workstation)
  62. local order = {};
  63. local orderValue = workstation.Occupied.Value:WaitForChild("Order")
  64.  
  65. for i,v in next, orderValue:GetChildren() do
  66. table.insert(order, v.Value);
  67. end
  68.  
  69. return order;
  70. end
  71.  
  72. -- Grab current job.
  73. local function getJob()
  74. return ((client['modules'] and client['modules'].ClientStats) and client['modules'].ClientStats:GetStat("Job").Value or nil);
  75. end
  76.  
  77. -- Grab job model.
  78. local function getJobModel()
  79. return (client['modules'].JobData and workspace:FindFirstChild(client['modules'].JobData:GetJob(currentJob).Location:gsub("%s+", "")) or nil);
  80. end
  81.  
  82. -- Grab job workstations.
  83. local function getJobWorkstations()
  84. for i,v in next, getJobModel():GetChildren() do
  85. if(string.match(v.Name, "Workstations")) then
  86. return v:GetChildren();
  87. end
  88. end
  89.  
  90. return {};
  91. end
  92.  
  93. -- Update UI
  94. local function updateUI()
  95. completedOrdersText.Text = "Completed Orders: " .. completedOrders;
  96. shiftEarningsText.Text = "Shift Earnings: " .. math.floor(client['modules'].ClientStats:GetStat("Job/ShiftEarnings").Value);
  97. end
  98.  
  99. -- Hook getfenv (Could have made a easier solution, idk why I did this it was 4am)
  100. local function hookGetfenv()
  101. local oldFunction;
  102. local thisEnv = getfenv(1);
  103.  
  104. local hook = function(x)
  105. local o = oldFunction(x)
  106.  
  107. if(o.script == thisEnv.script and thisEnv.script ~= player.PlayerGui.MainGUI.Scripts.JobManager) then
  108. o.script = player.PlayerGui.MainGUI.Scripts.JobManager;
  109. end
  110.  
  111. return o
  112. end
  113. oldFunction = hookfunction(getfenv, hook)
  114. end
  115.  
  116. -- WorkEvent and InUseEvent.
  117. local function setupEvents()
  118. if(workEvent ~= nil or type(workEvent) == "userdata") then
  119. workEvent:Disconnect();
  120. end
  121.  
  122. workEvent = currentWorkstation:FindFirstChild("Occupied").Changed:Connect(function(value)
  123. if(value == nil) then return; end
  124. if(not isActive) then
  125. workEvent:Disconnect();
  126. end
  127.  
  128. completedOrders = completedOrders + 1;
  129. updateUI();
  130.  
  131. client['modules'].DataManager:FireServer({
  132. Type = "JobTask",
  133. Workstation = currentWorkstation,
  134. Order = getOrder(currentWorkstation)
  135. })
  136. end)
  137. end
  138.  
  139. -- Do work.
  140. local function doWork()
  141. if(isWorkstationOccupied(currentWorkstation)) then
  142. client['modules'].DataManager:FireServer({
  143. Type = "JobTask",
  144. Workstation = currentWorkstation,
  145. Order = getOrder(currentWorkstation)
  146. })
  147. completedOrders = completedOrders + 1;
  148. end
  149.  
  150. setupEvents();
  151. end
  152.  
  153. -- Work thread.
  154. local function workThread()
  155. while wait() do
  156. local root = client['modules'].CharacterHandler:GetRoot(true);
  157. repeat wait() currentJob = getJob(); until currentJob ~= nil and isSupported();
  158.  
  159. for i,v in next, getJobWorkstations() do
  160. if(isWorkstationOccupied(v) and isWorkstationFree(v) and (root.Position - v.PrimaryPart.Position).magnitude < 10 and currentWorkstation ~= v) then
  161. client['modules'].DataManager:FireServer({
  162. Type = "UseWorkstation",
  163. Workstation = v
  164. });
  165. currentWorkstation = v;
  166.  
  167. doWork();
  168. elseif(currentWorkstation == v and not workEvent.Connected and isActive) then
  169. doWork();
  170. end
  171. end
  172. end
  173. end
  174.  
  175. -- Anti afk.
  176. local function antiAFK()
  177. player.Idled:Connect(function()
  178. virtualUser:CaptureController();
  179. virtualUser:ClickButton1(Vector2.new());
  180. end)
  181. end
  182.  
  183. -- Setup ui.
  184. local function setupUI()
  185. local ui = library:CreateWindow({
  186. text = "Bloxburg"
  187. });
  188.  
  189. local credits = library:CreateWindow({
  190. text = "Credits"
  191. });
  192. credits:AddLabel("Luaa: Creator\nInori: Dragging\nwally: UI\n");
  193.  
  194. ui:AddToggle("Auto Farm", function(state)
  195. isActive = (state and true or false);
  196. end)
  197.  
  198. completedOrdersText = ui:AddLabel("Completed Orders: " .. completedOrders);
  199. shiftEarningsText = ui:AddLabel("Shift Earnings: 0");
  200. end
  201.  
  202. -- Main function.
  203. local function initEGX()
  204. getClient();
  205.  
  206. if(client['modules'] == nil) then
  207. return;
  208. end
  209.  
  210. setupUI();
  211. antiAFK();
  212. hookGetfenv();
  213. workThread();
  214. end
  215.  
  216. initEGX();
RAW Paste Data