Advertisement
FurkingBoi

Bomb Simulator

Jun 5th, 2020
3,727
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.67 KB | None | 0 0
  1. -- Gui to Lua
  2. -- Version: 3
  3.  
  4. -- Instances:
  5.  
  6. local ScreenGui = Instance.new("ScreenGui")
  7. local Frame = Instance.new("Frame")
  8. local TextLabel = Instance.new("TextLabel")
  9. local TextButton = Instance.new("TextButton")
  10. local TextButton_2 = Instance.new("TextButton")
  11. local TextButton_3 = Instance.new("TextButton")
  12. local TextButton_4 = Instance.new("TextButton")
  13. local TextButton_5 = Instance.new("TextButton")
  14. local TextButton_6 = Instance.new("TextButton")
  15. local Frame_2 = Instance.new("Frame")
  16. local TextButton_7 = Instance.new("TextButton")
  17.  
  18. --Properties:
  19.  
  20. ScreenGui.Parent = game.CoreGui
  21.  
  22. Frame.Parent = ScreenGui
  23. Frame.BackgroundColor3 = Color3.new(0, 0, 0)
  24. Frame.Position = UDim2.new(0.0788844526, 0, 0.54004848, 0)
  25. Frame.Size = UDim2.new(0, 297, 0, 274)
  26. Frame.Visible = false
  27. Frame.Active = true
  28. Frame.Draggable = true
  29.  
  30. TextLabel.Parent = Frame
  31. TextLabel.BackgroundColor3 = Color3.new(1, 1, 1)
  32. TextLabel.Size = UDim2.new(0, 297, 0, 23)
  33. TextLabel.Font = Enum.Font.GothamBlack
  34. TextLabel.Text = "Bomb Simulator GUI"
  35. TextLabel.TextColor3 = Color3.new(0, 0, 0)
  36. TextLabel.TextSize = 20
  37.  
  38. TextButton.Parent = Frame
  39. TextButton.BackgroundColor3 = Color3.new(1, 1, 1)
  40. TextButton.Position = UDim2.new(0.0370370448, 0, 0.145985395, 0)
  41. TextButton.Size = UDim2.new(0, 124, 0, 50)
  42. TextButton.Font = Enum.Font.SourceSans
  43. TextButton.Text = "AutoFarm"
  44. TextButton.TextColor3 = Color3.new(0, 0, 0)
  45. TextButton.TextSize = 14
  46. TextButton.MouseButton1Down:connect(function()
  47. local region = 1 -- Change Area 1,2,3,4,5,6,7,8
  48. --get bombs
  49. local bombs = workspace.Resources.Regions[region].SpawnedBombs:GetChildren()
  50. --sort by distance from character, also by higher value
  51. local root = game.Players.LocalPlayer.Character.HumanoidRootPart
  52. table.sort(bombs,function(a,b)
  53. return (a.Ring.Position-root.Position).magnitude - tonumber(a.Name)*1e6 < (b.Ring.Position-root.Position).magnitude - tonumber(b.Name)*1e6
  54. end)
  55. --loop them
  56. for _,bomb in ipairs(bombs) do
  57. --check if it's visible
  58. local vispart
  59. for _,v in ipairs(bomb:GetDescendants()) do
  60. if v:IsA("BasePart") and v.Transparency < 0.1 then
  61. vispart = v
  62. break
  63. end
  64. end
  65. if vispart then
  66. --teleport to it
  67. root.CFrame = root.CFrame-root.CFrame.p+bomb.Ring.Position+Vector3.new(0,3,0)
  68. wait(0.2)
  69. local e = 0 --elapsed
  70. --while bomb visible...
  71. while e < region*15 and bomb.Parent and vispart.Parent and vispart.Transparency < 0.1 do
  72. --attack it
  73. for i=1,100 do
  74. spawn(function()game:GetService("ReplicatedStorage").Events.Server.BombAttack:InvokeServer(workspace.Resources.Regions[region], bomb)end)
  75. end
  76. e=e+wait()
  77. end
  78. wait(0.2)
  79. --collect rewards
  80. for _,pickup in ipairs(workspace.Resources.Pickups:GetChildren()) do
  81. game:GetService("ReplicatedStorage").Events.Client.BombReward:FireServer(pickup)
  82. end
  83. end
  84. end
  85. end)
  86.  
  87. TextButton_2.Parent = Frame
  88. TextButton_2.BackgroundColor3 = Color3.new(1, 1, 1)
  89. TextButton_2.Position = UDim2.new(0.508417487, 0, 0.145985395, 0)
  90. TextButton_2.Size = UDim2.new(0, 124, 0, 50)
  91. TextButton_2.Font = Enum.Font.SourceSans
  92. TextButton_2.Text = "Sell Inventory"
  93. TextButton_2.TextColor3 = Color3.new(0, 0, 0)
  94. TextButton_2.TextSize = 14
  95. TextButton_2.MouseButton1Down:connect(function()
  96. --sell inventory
  97. local data = game:GetService("ReplicatedStorage").Events.Server.GetData:InvokeServer("Data")
  98. for k,hat in pairs(data.HatInv) do
  99. spawn(function()game:GetService("ReplicatedStorage").Events.Server.RequestHatSell:InvokeServer(hat.id) end)
  100. end
  101. end)
  102.  
  103. TextButton_6.Parent = Frame
  104. TextButton_6.BackgroundColor3 = Color3.new(1, 0, 0)
  105. TextButton_6.Position = UDim2.new(0.92592591, 0, 0, 0)
  106. TextButton_6.Size = UDim2.new(0, 22, 0, 23)
  107. TextButton_6.Font = Enum.Font.GothamBold
  108. TextButton_6.Text = "X"
  109. TextButton_6.TextColor3 = Color3.new(0, 0, 0)
  110. TextButton_6.TextSize = 28
  111. TextButton_6.MouseButton1Down:connect(function()
  112. Frame.Visible = false
  113. Frame_2.Visible = true
  114. end)
  115.  
  116. Frame_2.Parent = ScreenGui
  117. Frame_2.BackgroundColor3 = Color3.new(1, 1, 1)
  118. Frame_2.Position = UDim2.new(0.00717131514, 0, 0.444174707, 0)
  119. Frame_2.Size = UDim2.new(0, 91, 0, 28)
  120. Frame.Active = true
  121. Frame.Draggable = true
  122.  
  123.  
  124. TextButton_7.Parent = Frame_2
  125. TextButton_7.BackgroundColor3 = Color3.new(1, 1, 1)
  126. TextButton_7.Position = UDim2.new(0, 0, 0.0357142873, 0)
  127. TextButton_7.Size = UDim2.new(0, 190, 0, 260)
  128. TextButton_7.Font = Enum.Font.SourceSans
  129. TextButton_7.Text = "Open"
  130. TextButton_7.TextColor3 = Color3.new(0, 0, 0)
  131. TextButton_7.TextSize = 14
  132. TextButton_7.MouseButton1Down:connect(function()
  133. Frame_2.Visible = false
  134. Frame.Visible = true
  135. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement