Advertisement
ErasedCitizen

Untitled

Mar 12th, 2025
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.59 KB | Source Code | 0 0
  1. -- Create the ScreenGui
  2. local screenGui = Instance.new("ScreenGui")
  3. screenGui.Parent = game.Players.LocalPlayer.PlayerGui
  4.  
  5. -- Create the Frame (optional, but good for organization)
  6. local frame = Instance.new("Frame")
  7. frame.Size = UDim2.new(0, 300, 0, 155) -- Adjust size as needed
  8. frame.Position = UDim2.new(0.5, -150, 0.5, -100) -- Center the frame
  9. frame.BackgroundColor3 = Color3.new(0, 0, 0)
  10. frame.Draggable = true
  11. frame.Parent = screenGui
  12.  
  13. -- Create the TextBox
  14. local textBox = Instance.new("TextBox")
  15. textBox.Size = UDim2.new(1, -20, 0, 30)
  16. textBox.Position = UDim2.new(0, 10, 0, 70)
  17. textBox.Text = "Diamond" -- Default value
  18. textBox.TextScaled = true
  19. textBox.Parent = frame
  20.  
  21. -- Create the TextButton
  22. local textButton = Instance.new("TextButton")
  23. textButton.Size = UDim2.new(0, 100, 0, 30) -- Adjust size as needed
  24. textButton.Position = UDim2.new(0.5, -50, 0, 120) -- Position below the textbox
  25. textButton.Text = "Execute"
  26. textButton.BackgroundColor3 = Color3.new(255, 0, 1) -- Light blue button
  27. textButton.Parent = frame
  28.  
  29. -- Create the TextLabel
  30. local textLabel = Instance.new("TextLabel")
  31. textLabel.Size = UDim2.new(1, -20, 0, 30) -- Fill width, adjust height
  32. textLabel.Position = UDim2.new(0, 10, 0, 10) -- Position below the button
  33. textLabel.Text = "1x98n6ex6:Drilling Simulator"
  34. textLabel.TextColor3 = Color3.new(1, 1, 1)
  35. textLabel.TextScaled = true
  36. textLabel.BackgroundColor3 = Color3.new(1, 0, 0) -- White background
  37. textLabel.Parent = frame
  38.  
  39. -- Button Functionality (Example)
  40. local running = false -- Add a variable to control the loop
  41.  
  42. textButton.MouseButton1Click:Connect(function()
  43.     running = not running -- Toggle the running state
  44.  
  45.     if running then
  46.         textButton.Text = "Stop" -- Change button text when running
  47.         while running do
  48.             local diamondName = textBox.Text -- Get the diamond name from the textbox
  49.             local diamond = game:GetService("Players").LocalPlayer.Character:FindFirstChild(diamondName)
  50.  
  51.             if diamond then -- Check if the diamond exists
  52.                 local args = {[1] = diamond}
  53.                 game:GetService("ReplicatedStorage"):WaitForChild("GiveCash"):FireServer(unpack(args))
  54.             else
  55.                 print("Diamond '" .. diamondName .. "' not found in character!")
  56.                 running = false
  57.                 textButton.Text = "Execute"
  58.                 break
  59.             end
  60.             wait(0.2)
  61.         end
  62.         if not running then
  63.             textButton.Text = "Execute"
  64.         end
  65.     else
  66.         textButton.Text = "Execute" -- Reset button text when stopped
  67.     end
  68. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement