Advertisement
Honansik

Destruction Simulator GUI Script [Add Money/Add Level]

Dec 18th, 2021
1,281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.78 KB | None | 0 0
  1. local player = game.Players.LocalPlayer
  2.  
  3. local newgui = Instance.new("ScreenGui")
  4. local mainframe = Instance.new("Frame")
  5. local CoinLabel = Instance.new("TextLabel")
  6. local CoinBox = Instance.new("TextBox")
  7. local AddCoins = Instance.new("TextButton")
  8. local LevelLabel = Instance.new("TextLabel")
  9. local LevelBox = Instance.new("TextBox")
  10. local AddLevel = Instance.new("TextButton")
  11.  
  12. newgui.Name = "NewGui"
  13. newgui.Parent = player.PlayerGui
  14.  
  15. mainframe.Name = "MainFrame"
  16. mainframe.BackgroundColor3 = Color3.fromRGB(100,20,50)
  17. mainframe.BorderSizePixel = 0
  18. mainframe.Position = UDim2.new(0.35,0,0.2,0)
  19. mainframe.Size = UDim2.new(0.3,0,0.45,0)
  20. mainframe.Active = true
  21. mainframe.Selectable = true
  22. mainframe.Draggable = true
  23. mainframe.Parent = newgui
  24.  
  25. CoinLabel.Name = "CoinLabel"
  26. CoinLabel.Text = "Coins (Max: 99,999,999)"
  27. CoinLabel.BackgroundTransparency = 1
  28. CoinLabel.TextScaled = true
  29. CoinLabel.Size = UDim2.new(0.4,0,0.05,0)
  30. CoinLabel.Position = UDim2.new(0.1,0,0.2,0)
  31. CoinLabel.TextColor3 = Color3.fromRGB(0,100,255)
  32. CoinLabel.Parent = mainframe
  33.  
  34. CoinBox.Name = "CoinBox"
  35. CoinBox.PlaceholderText = "Coins"
  36. CoinBox.Text = ""
  37. CoinBox.Size = UDim2.new(0.3,0,0.125,0)
  38. CoinBox.Position = UDim2.new(0.1,0,0.3,0)
  39. CoinBox.TextScaled = true
  40. CoinBox.ClearTextOnFocus = false
  41. CoinBox.BackgroundColor3 = Color3.fromRGB(255,255,255)
  42. CoinBox.Parent = mainframe
  43.  
  44. AddCoins.Name = "AddCoins"
  45. AddCoins.Text = "Add Coins"
  46. AddCoins.BackgroundColor3 = Color3.fromRGB(0,255,0)
  47. AddCoins.Size = UDim2.new(0.3,0,0.1,0)
  48. AddCoins.Position = UDim2.new(0.1,0,0.5,0)
  49. AddCoins.TextScaled = true
  50. AddCoins.Parent = mainframe
  51.  
  52. LevelLabel.Name = "LevelLabel"
  53. LevelLabel.Text = "Level (Max: 55)"
  54. LevelLabel.BackgroundTransparency = 1
  55. LevelLabel.TextScaled = true
  56. LevelLabel.Size = UDim2.new(0.4,0,0.05,0)
  57. LevelLabel.Position = UDim2.new(0.6,0,0.2,0)
  58. LevelLabel.TextColor3 = Color3.fromRGB(0,100,255)
  59. LevelLabel.Parent = mainframe
  60.  
  61. LevelBox.Name = "LevelBox"
  62. LevelBox.PlaceholderText = "Level"
  63. LevelBox.Text = ""
  64. LevelBox.Size = UDim2.new(0.3,0,0.125,0)
  65. LevelBox.Position = UDim2.new(0.6,0,0.3,0)
  66. LevelBox.TextScaled = true
  67. LevelBox.ClearTextOnFocus = false
  68. LevelBox.BackgroundColor3 = Color3.fromRGB(255,255,255)
  69. LevelBox.Parent = mainframe
  70.  
  71. AddLevel.Name = "AddLevel"
  72. AddLevel.Text = "Add Level"
  73. AddLevel.BackgroundColor3 = Color3.fromRGB(0,255,0)
  74. AddLevel.Size = UDim2.new(0.3,0,0.1,0)
  75. AddLevel.Position = UDim2.new(0.6,0,0.5,0)
  76. AddLevel.TextScaled = true
  77. AddLevel.Parent = mainframe
  78.  
  79. local Event = game:GetService("ReplicatedStorage").Remotes.generateBoost
  80.  
  81. AddCoins.MouseButton1Down:Connect(function()
  82.     local Amount = tonumber(CoinBox.Text)
  83.     if Amount then
  84.         Event:FireServer("Coins", 999999, Amount)
  85.     end
  86. end)
  87.  
  88. AddLevel.MouseButton1Click:Connect(function()
  89.     local Amount = tonumber(LevelBox.Text)
  90.     if Amount then
  91.         local LevelValue = player.leaderstats.Level
  92.         if Amount > LevelValue.Value then
  93.             local Difference = Amount - LevelValue.Value
  94.             repeat
  95.                 local FireAmount = Difference
  96.                 if FireAmount > 15 then
  97.                     FireAmount = 15
  98.                 end
  99.                 Event:FireServer("Levels", 480, FireAmount)
  100.                 Difference -= FireAmount
  101.                 wait()
  102.             until Difference == 0
  103.         elseif Amount < LevelValue.Value then
  104.             local Difference = Amount - LevelValue.Value
  105.             repeat
  106.                 local FireAmount = Difference
  107.                 if FireAmount < -15 then
  108.                     FireAmount = -15
  109.                 end
  110.                 print(FireAmount)
  111.                 Event:FireServer("Levels", 480, FireAmount)
  112.                 Difference -= FireAmount
  113.                 wait()
  114.             until Difference == 0
  115.         end
  116.     end
  117. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement