Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Gui to Lua
- -- Version: 3
- -- Instances:
- local ScreenGui = Instance.new("ScreenGui")
- local Frame = Instance.new("Frame")
- local TextLabel = Instance.new("TextLabel")
- local TextButton = Instance.new("TextButton")
- local TextButton_2 = Instance.new("TextButton")
- local TextButton_3 = Instance.new("TextButton")
- local TextButton_4 = Instance.new("TextButton")
- local TextButton_5 = Instance.new("TextButton")
- local TextButton_6 = Instance.new("TextButton")
- local Frame_2 = Instance.new("Frame")
- local TextButton_7 = Instance.new("TextButton")
- --Properties:
- ScreenGui.Parent = game.CoreGui
- Frame.Parent = ScreenGui
- Frame.BackgroundColor3 = Color3.new(0, 0, 0)
- Frame.Position = UDim2.new(0.0788844526, 0, 0.54004848, 0)
- Frame.Size = UDim2.new(0, 297, 0, 274)
- Frame.Visible = false
- Frame.Active = true
- Frame.Draggable = true
- TextLabel.Parent = Frame
- TextLabel.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel.Size = UDim2.new(0, 297, 0, 23)
- TextLabel.Font = Enum.Font.GothamBlack
- TextLabel.Text = "Bomb Simulator GUI"
- TextLabel.TextColor3 = Color3.new(0, 0, 0)
- TextLabel.TextSize = 20
- TextButton.Parent = Frame
- TextButton.BackgroundColor3 = Color3.new(1, 1, 1)
- TextButton.Position = UDim2.new(0.0370370448, 0, 0.145985395, 0)
- TextButton.Size = UDim2.new(0, 124, 0, 50)
- TextButton.Font = Enum.Font.SourceSans
- TextButton.Text = "AutoFarm"
- TextButton.TextColor3 = Color3.new(0, 0, 0)
- TextButton.TextSize = 14
- TextButton.MouseButton1Down:connect(function()
- local region = 1 -- Change Area 1,2,3,4,5,6,7,8
- --get bombs
- local bombs = workspace.Resources.Regions[region].SpawnedBombs:GetChildren()
- --sort by distance from character, also by higher value
- local root = game.Players.LocalPlayer.Character.HumanoidRootPart
- table.sort(bombs,function(a,b)
- return (a.Ring.Position-root.Position).magnitude - tonumber(a.Name)*1e6 < (b.Ring.Position-root.Position).magnitude - tonumber(b.Name)*1e6
- end)
- --loop them
- for _,bomb in ipairs(bombs) do
- --check if it's visible
- local vispart
- for _,v in ipairs(bomb:GetDescendants()) do
- if v:IsA("BasePart") and v.Transparency < 0.1 then
- vispart = v
- break
- end
- end
- if vispart then
- --teleport to it
- root.CFrame = root.CFrame-root.CFrame.p+bomb.Ring.Position+Vector3.new(0,3,0)
- wait(0.2)
- local e = 0 --elapsed
- --while bomb visible...
- while e < region*15 and bomb.Parent and vispart.Parent and vispart.Transparency < 0.1 do
- --attack it
- for i=1,100 do
- spawn(function()game:GetService("ReplicatedStorage").Events.Server.BombAttack:InvokeServer(workspace.Resources.Regions[region], bomb)end)
- end
- e=e+wait()
- end
- wait(0.2)
- --collect rewards
- for _,pickup in ipairs(workspace.Resources.Pickups:GetChildren()) do
- game:GetService("ReplicatedStorage").Events.Client.BombReward:FireServer(pickup)
- end
- end
- end
- end)
- TextButton_2.Parent = Frame
- TextButton_2.BackgroundColor3 = Color3.new(1, 1, 1)
- TextButton_2.Position = UDim2.new(0.508417487, 0, 0.145985395, 0)
- TextButton_2.Size = UDim2.new(0, 124, 0, 50)
- TextButton_2.Font = Enum.Font.SourceSans
- TextButton_2.Text = "Sell Inventory"
- TextButton_2.TextColor3 = Color3.new(0, 0, 0)
- TextButton_2.TextSize = 14
- TextButton_2.MouseButton1Down:connect(function()
- --sell inventory
- local data = game:GetService("ReplicatedStorage").Events.Server.GetData:InvokeServer("Data")
- for k,hat in pairs(data.HatInv) do
- spawn(function()game:GetService("ReplicatedStorage").Events.Server.RequestHatSell:InvokeServer(hat.id) end)
- end
- end)
- TextButton_6.Parent = Frame
- TextButton_6.BackgroundColor3 = Color3.new(1, 0, 0)
- TextButton_6.Position = UDim2.new(0.92592591, 0, 0, 0)
- TextButton_6.Size = UDim2.new(0, 22, 0, 23)
- TextButton_6.Font = Enum.Font.GothamBold
- TextButton_6.Text = "X"
- TextButton_6.TextColor3 = Color3.new(0, 0, 0)
- TextButton_6.TextSize = 28
- TextButton_6.MouseButton1Down:connect(function()
- Frame.Visible = false
- Frame_2.Visible = true
- end)
- Frame_2.Parent = ScreenGui
- Frame_2.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame_2.Position = UDim2.new(0.00717131514, 0, 0.444174707, 0)
- Frame_2.Size = UDim2.new(0, 91, 0, 28)
- Frame.Active = true
- Frame.Draggable = true
- TextButton_7.Parent = Frame_2
- TextButton_7.BackgroundColor3 = Color3.new(1, 1, 1)
- TextButton_7.Position = UDim2.new(0, 0, 0.0357142873, 0)
- TextButton_7.Size = UDim2.new(0, 190, 0, 260)
- TextButton_7.Font = Enum.Font.SourceSans
- TextButton_7.Text = "Open"
- TextButton_7.TextColor3 = Color3.new(0, 0, 0)
- TextButton_7.TextSize = 14
- TextButton_7.MouseButton1Down:connect(function()
- Frame_2.Visible = false
- Frame.Visible = true
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement