Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Create the ScreenGui
- local screenGui = Instance.new("ScreenGui")
- screenGui.Parent = game.Players.LocalPlayer.PlayerGui
- -- Create the Frame (optional, but good for organization)
- local frame = Instance.new("Frame")
- frame.Size = UDim2.new(0, 300, 0, 155) -- Adjust size as needed
- frame.Position = UDim2.new(0.5, -150, 0.5, -100) -- Center the frame
- frame.BackgroundColor3 = Color3.new(0, 0, 0)
- frame.Draggable = true
- frame.Parent = screenGui
- -- Create the TextBox
- local textBox = Instance.new("TextBox")
- textBox.Size = UDim2.new(1, -20, 0, 30)
- textBox.Position = UDim2.new(0, 10, 0, 70)
- textBox.Text = "Diamond" -- Default value
- textBox.TextScaled = true
- textBox.Parent = frame
- -- Create the TextButton
- local textButton = Instance.new("TextButton")
- textButton.Size = UDim2.new(0, 100, 0, 30) -- Adjust size as needed
- textButton.Position = UDim2.new(0.5, -50, 0, 120) -- Position below the textbox
- textButton.Text = "Execute"
- textButton.BackgroundColor3 = Color3.new(255, 0, 1) -- Light blue button
- textButton.Parent = frame
- -- Create the TextLabel
- local textLabel = Instance.new("TextLabel")
- textLabel.Size = UDim2.new(1, -20, 0, 30) -- Fill width, adjust height
- textLabel.Position = UDim2.new(0, 10, 0, 10) -- Position below the button
- textLabel.Text = "1x98n6ex6:Drilling Simulator"
- textLabel.TextColor3 = Color3.new(1, 1, 1)
- textLabel.TextScaled = true
- textLabel.BackgroundColor3 = Color3.new(1, 0, 0) -- White background
- textLabel.Parent = frame
- -- Button Functionality (Example)
- local running = false -- Add a variable to control the loop
- textButton.MouseButton1Click:Connect(function()
- running = not running -- Toggle the running state
- if running then
- textButton.Text = "Stop" -- Change button text when running
- while running do
- local diamondName = textBox.Text -- Get the diamond name from the textbox
- local diamond = game:GetService("Players").LocalPlayer.Character:FindFirstChild(diamondName)
- if diamond then -- Check if the diamond exists
- local args = {[1] = diamond}
- game:GetService("ReplicatedStorage"):WaitForChild("GiveCash"):FireServer(unpack(args))
- else
- print("Diamond '" .. diamondName .. "' not found in character!")
- running = false
- textButton.Text = "Execute"
- break
- end
- wait(0.2)
- end
- if not running then
- textButton.Text = "Execute"
- end
- else
- textButton.Text = "Execute" -- Reset button text when stopped
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement