Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local player = game.Players.LocalPlayer
- local leaderstats = player:WaitForChild("leaderstats") -- Make sure these values are typed in correctly
- local pts = leaderstats:WaitForChild("Points") -- Rename Points to your main value
- local button = script.Parent
- local Debounce = false -- The Debounce will act like a cooldown for our button. Leave this as false.
- button.MouseButton1Click:Connect(function()
- if Debounce == false then
- Debounce = true
- 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.
- wait(0.15) -- This is your cooldown timer. It takes this long before the button can be pressed again.
- Debounce = false
- end
- end)
- -- If you want to have your game exactly like the one I am currently making, don't touch the script at all.
- -- 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.
- -- 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