Hello, I Really Need Help In This And I'm A Beginner Is Coding So Could You Please Help Me With This Script??
local db = false local tool = script.Parent repeat wait() until tool.Parent.Parent:IsA("Player") local plr = tool.Parent.Parent local character = plr.Character tool.Activated:Connect(function() if not db then plr.leaderstats.Power.Value = plr.leaderstats.Power.Value + 1 db = false end end)
Your debounce isn't set up correctly. You set debounce to false even though it is already false and you have no cooldown.
local db = false local tool = script.Parent repeat wait() until tool.Parent.Parent:IsA("Player") local plr = tool.Parent.Parent local character = plr.Character tool.Activated:Connect(function() if not db then db = true plr.leaderstats.Power.Value = plr.leaderstats.Power.Value + 1 wait(1) -- this is the cooldown, edit 1 to whatever number to make it longer or shorter db = false end end)
You can use roblox's sample on debounce if you need more help with it: https://developer.roblox.com/en-us/articles/Debounce
Marked as Duplicate by User#6546
This question has been asked before, and already has an answer. If those answers do not fully address your question, then please ask a new question here.
Why was this question closed?