TheNadie

Auto Rob MadCity

Feb 9th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.37 KB | None | 0 0
  1. game:GetService("RunService").Stepped:connect(function()
  2. game.Players.LocalPlayer.Character.Head.CanCollide = false
  3. game.Players.LocalPlayer.Character.LowerTorso.CanCollide = false
  4. game.Players.LocalPlayer.Character.HumanoidRootPart.CanCollide = false
  5. game.Players.LocalPlayer.Character.UpperTorso.CanCollide = false
  6. end)
  7.  
  8. game.Players.LocalPlayer.Character.HumanoidRootPart.Changed:connect(function()
  9. game.Players.LocalPlayer.Character.Head.CanCollide = false
  10. game.Players.LocalPlayer.Character.LowerTorso.CanCollide = false
  11. game.Players.LocalPlayer.Character.HumanoidRootPart.CanCollide = false
  12. game.Players.LocalPlayer.Character.UpperTorso.CanCollide = false
  13. end)
  14.  
  15. local busy = false
  16. local busy_with = "busy_with"
  17. local thing = "thing"
  18. local busy_str = "Can't rob %s because you are busy with %s"
  19. local not_finished = "Can't rob other things because the %s rob isn't finished"
  20.  
  21. local cashRegister = coroutine.wrap(function()
  22. while wait(5) do
  23. pcall(function()
  24. if busy == false then
  25. for i, v in pairs(workspace.ObjectSelection:GetChildren()) do
  26. if v.Name == "CashRegister" then
  27. local part = v:FindFirstChildOfClass("Part")
  28. if part.Name ~= "Nope" then
  29. busy = true
  30. busy_with = "cash registers"
  31. local pos = v.SmashCash.Position
  32. for i = 1, math.random(5,10) do
  33. wait(.1)
  34. game.Players.LocalPlayer.Character.HumanoidRootPart.Position = pos
  35. end
  36. wait(0.3)
  37. v.SmashCash.SmashCash.Event:FireServer()
  38. wait(2)
  39. if part.Name ~= "Nope" then
  40. warn(string.format(not_finished, "cash registers"))
  41. else
  42. busy = false
  43. end
  44. end
  45. end
  46. end
  47. else
  48. thing = "cash registers"
  49. warn(string.format(busy_str, thing, busy_with))
  50. end
  51. end)
  52. end
  53. end)
  54.  
  55. local diamondBox = coroutine.wrap(function()
  56. while wait(5) do
  57. pcall(function()
  58. if busy == false then
  59. for i, v in pairs(workspace.ObjectSelection:GetChildren()) do
  60. if v.Name == "DiamondBox" then
  61. local part = v:FindFirstChildOfClass("Part")
  62. if part.Name ~= "Nope" then
  63. busy = true
  64. busy_with = "diamond boxes"
  65. local pos = v.SmashCash.Position
  66. for i = 1, math.random(5,10) do
  67. wait(.1)
  68. game.Players.LocalPlayer.Character.HumanoidRootPart.Position = pos
  69. end
  70. wait(0.3)
  71. v.SmashCash.SmashCash.Event:FireServer()
  72. wait(2)
  73. if part.Name ~= "Nope" then
  74. warn(string.format(not_finished, "diamond boxes"))
  75. else
  76. busy = false
  77. end
  78. end
  79. end
  80. end
  81. else
  82. thing = "diamond boxes"
  83. warn(string.format(busy_str, thing, busy_with))
  84. end
  85. end)
  86. end
  87. end)
  88.  
  89. local safe = coroutine.wrap(function()
  90. while wait(5) do
  91. pcall(function()
  92. if busy == false then
  93. for i, v in pairs(workspace.ObjectSelection:GetChildren()) do
  94. if v.Name == "Safe" then
  95. local part = v:FindFirstChildOfClass("Part")
  96. if part.Name ~= "Nope" then
  97. busy = true
  98. busy_with = "safes"
  99. local pos = v.SmashCash.Position
  100. for i = 1, math.random(5,10) do
  101. wait(.1)
  102. game.Players.LocalPlayer.Character.HumanoidRootPart.Position = pos
  103. end
  104. wait(0.3)
  105. v.SmashCash.SmashCash.Event:FireServer()
  106. wait(2)
  107. if part.Name ~= "Nope" then
  108. warn(string.format(not_finished, "safes"))
  109. else
  110. busy = false
  111. end
  112. end
  113. end
  114. end
  115. else
  116. thing = "safes"
  117. warn(string.format(busy_str, thing, busy_with))
  118. end
  119. end)
  120. end
  121. end)
  122.  
  123. local tipJar = coroutine.wrap(function()
  124. while wait(5) do
  125. pcall(function()
  126. if busy == false then
  127. for i, v in pairs(workspace.ObjectSelection:GetChildren()) do
  128. if v.Name == "TipJar" then
  129. local part = v:FindFirstChildOfClass("Part")
  130. if part.Name == "SmashCash" then
  131. busy = true
  132. busy_with = "tip jars"
  133. local pos = v.SmashCash.Position
  134. for i = 1, math.random(5,10) do
  135. wait(.1)
  136. game.Players.LocalPlayer.Character.HumanoidRootPart.Position = pos
  137. end
  138. wait(0.3)
  139. v.SmashCash.SmashCash.Event:FireServer()
  140. wait(2)
  141. if part.Name == "SmashCash" then
  142. warn(string.format(not_finished, "tip jars"))
  143. else
  144. busy = false
  145. end
  146. end
  147. end
  148. end
  149. else
  150. thing = "tip jars"
  151. warn(string.format(busy_str, thing, busy_with))
  152. end
  153. end)
  154. end
  155. end)
  156.  
  157. local cash = coroutine.wrap(function()
  158. while wait(5) do
  159. pcall(function()
  160. if busy == false then
  161. for i, v in pairs(workspace.ObjectSelection:GetChildren()) do
  162. if v.Name == "Cash" then
  163. local part = v:FindFirstChildOfClass("MeshPart")
  164. if part.Name == "Cash" then
  165. busy = true
  166. busy_with = "cash"
  167. local pos = v.Cash.Position
  168. for i = 1, math.random(5,10) do
  169. wait(.1)
  170. game.Players.LocalPlayer.Character.HumanoidRootPart.Position = pos
  171. end
  172. wait(0.3)
  173. v.Cash.Cash.Event:FireServer()
  174. wait(2)
  175. if part.Name == "Cash" then
  176. warn(string.format(not_finished, "cash"))
  177. else
  178. busy = false
  179. end
  180. end
  181. end
  182. end
  183. else
  184. thing = "cash"
  185. warn(string.format(busy_str, thing, busy_with))
  186. end
  187. end)
  188. end
  189. end)
  190.  
  191. local tv = coroutine.wrap(function()
  192. while wait(5) do
  193. pcall(function()
  194. if busy == false then
  195. for i, v in pairs(workspace.ObjectSelection:GetChildren()) do
  196. if v.Name == "TV" then
  197. local part = v:FindFirstChildOfClass("Part")
  198. if part.Name ~= "Nope" then
  199. busy = true
  200. busy_with = "TVs"
  201. local pos = v.StealTV.Position
  202. for i = 1, math.random(5,10) do
  203. wait(.1)
  204. game.Players.LocalPlayer.Character.HumanoidRootPart.Position = pos
  205. end
  206. wait(0.3)
  207. v.StealTV.StealTV.Event:FireServer()
  208. wait(2)
  209. if part.Name ~= "Nope" then
  210. warn(string.format(not_finished, "TVs"))
  211. else
  212. busy = false
  213. end
  214. end
  215. end
  216. end
  217. else
  218. thing = "TVs"
  219. warn(string.format(busy_str, thing, busy_with))
  220. end
  221. end)
  222. end
  223. end)
  224.  
  225. local dropCrate = coroutine.wrap(function()
  226. while wait(5) do
  227. pcall(function()
  228. if busy == false then
  229. for i, v in pairs(workspace.ObjectSelection:GetChildren()) do
  230. if v.Name == "DropCrate" then
  231. local part = v:FindFirstChildOfClass("Part")
  232. if part.Name ~= "Nope" then
  233. busy = true
  234. busy_with = "drop crates"
  235. local pos = v.DropCrate.Position
  236. for i = 1, math.random(5,10) do
  237. wait(.1)
  238. game.Players.LocalPlayer.Character.HumanoidRootPart.Position = pos
  239. end
  240. wait(0.3)
  241. v.DropCrate.DropCrate.Event:FireServer()
  242. wait(2)
  243. if part.Name ~= "Nope" then
  244. warn(string.format(not_finished, "drop crates"))
  245. else
  246. busy = false
  247. end
  248. end
  249. end
  250. end
  251. else
  252. thing = "drop crates"
  253. warn(string.format(busy_str, thing, busy_with))
  254. end
  255. end)
  256. end
  257. end)
  258.  
  259. local atm = coroutine.wrap(function()
  260. while wait(5) do
  261. pcall(function()
  262. if busy == false then
  263. for i, v in pairs(workspace.ObjectSelection:GetChildren()) do
  264. if v.Name == "ATM" then
  265. local part = v:FindFirstChildOfClass("Part")
  266. if part.Name ~= "Nope" then
  267. busy = true
  268. busy_with = "ATMs"
  269. local pos = v.ATM.Position
  270. for i = 1, math.random(5,10) do
  271. wait(.1)
  272. game.Players.LocalPlayer.Character.HumanoidRootPart.Position = pos
  273. end
  274. wait(0.3)
  275. v.ATM.ATM.Event:FireServer()
  276. wait(2)
  277. if part.Name ~= "Nope" then
  278. warn(string.format(not_finished, "ATMs"))
  279. else
  280. busy = false
  281. end
  282. end
  283. end
  284. end
  285. else
  286. thing = "ATMs"
  287. warn(string.format(busy_str, thing, busy_with))
  288. end
  289. end)
  290. end
  291. end)
  292.  
  293. cashRegister()
  294. wait(20)
  295. diamondBox()
  296. wait(15)
  297. safe()
  298. wait(15)
  299. tipJar()
  300. wait(15)
  301. cash()
  302. wait(15)
  303. tv()
  304. --wait(15)
  305. --dropCrate()
  306. wait(15)
  307. atm()
Add Comment
Please, Sign In to add comment