Advertisement
SourceYT

Point Button Script

Apr 6th, 2021
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.09 KB | None | 0 0
  1. local player = game.Players.LocalPlayer
  2.  
  3. local leaderstats = player:WaitForChild("leaderstats") -- Make sure these values are typed in correctly
  4. local pts = leaderstats:WaitForChild("Points") -- Rename Points to your main value
  5. local button = script.Parent
  6.  
  7. local Debounce = false -- The Debounce will act like a cooldown for our button. Leave this as false.
  8.  
  9. button.MouseButton1Click:Connect(function()
  10.     if Debounce == false then
  11.         Debounce = true
  12.        
  13.         pts.Value = pts.Value + 1 -- If I end up doing an advanced tutorial, I'll show you how to add multipliers if you're going to be using gamepasses.
  14.         wait(0.15) -- This is your cooldown timer. It takes this long before the button can be pressed again.
  15.        
  16.         Debounce = false
  17.     end
  18.    
  19. end)
  20.  
  21. -- If you want to have your game exactly like the one I am currently making, don't touch the script at all.
  22. -- Basically what we did was define our variables like usual at the top, and add in a Debounce which will act like a cooldown for our button.
  23. -- More may be added to the script in the future, but for now, this is all you'll need for a basic simulator.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement