local Player = game.Players.LocalPlayer local Character = Player.Character or Player.CharacterAdded:Wait() local debounce = false script.Parent.MouseButton1Click:Connect(function() if Character.HumanoidRootPart.Anchored == false then if debounce == false then debounce = true if Player.leaderstats.Nature.Value == "Fire" then game.ReplicatedStorage.FireWall:FireServer() elseif Player.leaderstats.Nature.Value == "Grass" then game.ReplicatedStorage.GWall2:FireServer() elseif Player.leaderstats.Nature.Value == "Water" then game.ReplicatedStorage.WaWalk2:FireServer() end end wait(7) debounce = false end end) --This is a local Script BTW
^^^ Here is my code, When I press the button, Sometimes I can use the move multiple times without waiting for the cooldown. Like there is no cooldown at all on the move. Anybody know why?
I am not sure whether it will work or not, but try to keep your debounce
in a single if
statement. Here's an example :
local debounce = false if debounce == false then debounce = true wait(7) debounce = false end -- And you did local debounce = false if debounce == false then debounce = true end wait(7) debounce = false
Lemme know if it helps!