Jjgames

Bloxburg Grinders Script free

Mar 23rd, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.42 KB | None | 0 0
  1. -- Variables --
  2. local inUseEvent = nil
  3. local workEvent = nil
  4. local remote = nil
  5. local workstation = nil
  6. local orderInc = 0
  7. local findRemWork = true
  8.  
  9. -- Metatable --
  10. function setupMetatable()
  11. warn("[?] Setting up the Metamethods.")
  12.  
  13. -- Metatable and Metamethods --
  14. local metatable = getrawmetatable(game)
  15. local backupNamecall = metatable.__namecall
  16.  
  17. -- Make metatable writeable --
  18. local setreadonly = make_writeable or setreadonly
  19. setreadonly(metatable, false)
  20.  
  21. -- Overwrite __namecall metamethod --
  22. metatable.__namecall = function(...)
  23. local args = {...}
  24. if(args[#args] == "FireServer") then
  25. if(args[2] and type(args[2]) == "table" and args[2]["Order"] and findRemWork) then
  26. warn("[!] Remote and Workstation have been found.")
  27. findRemWork = false
  28. remote = args[1]
  29. workstation = args[2]["Workstation"]
  30.  
  31. doWork()
  32. end
  33. end
  34. return backupNamecall(...)
  35. end
  36. end
  37.  
  38. -- Find Customer --
  39. function getOrder(workstation)
  40. local orderValue = workstation.Occupied.Value:WaitForChild("Order")
  41.  
  42. return {
  43. orderValue.Burger.Value,
  44. orderValue.Fries.Value,
  45. orderValue.Cola.Value
  46. }
  47. end
  48.  
  49. -- Main --
  50. warn("[?] Welcome to Bloxy Burgers Farm Script!")
  51. warn("[?] By Luaa #0381")
  52. warn("[-] Go to work at Bloxy Burgers.")
  53. warn("[-] Complete an order.")
  54. warn("[-] Magic, it will now complete orders.")
  55. setupMetatable()
  56.  
  57. function doWork()
  58. workEvent = workstation.Occupied.Changed:Connect(function(value)
  59. if(value == nil) then return end
  60.  
  61. local order = getOrder(workstation)
  62. remote:FireServer({
  63. Type = "FinishOrder",
  64. Workstation = workstation,
  65. Order = order
  66. })
  67.  
  68. orderInc = orderInc + 1
  69. local date = os.date("*t", now)
  70. warn("[!] Finished Order => " .. orderInc .. " => " .. date["hour"] .. ":" .. date["min"])
  71. end)
  72.  
  73. inUseEvent = workstation.InUse.Changed:Connect(function(value)
  74. if(value ~= game:GetService("Players").LocalPlayer and workEvent ~= nil) then
  75. warn("[?] You have changed your workstation, stopping old workEvent and resetting metamethod.")
  76. findRemWork = true
  77. workEvent:Disconnect()
  78. inUseEvent:Disconnect()
  79. end
  80. end)
  81. end
Add Comment
Please, Sign In to add comment