Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why does the output return so much 'noob' for debounce?

So let me explain this I am trying to check whether a debounce is false or not by using print. But it keeps returning massive numbers for every time i equip and unequiped

repeat wait() until game.Players.LocalPlayer

local Player = game.Players.LocalPlayer

local Character = Player.Character

local Humanoid = Character.Humanoid

  

local Tool = script.Parent

local Handle = Tool.Handle

local Equip = false

  

Tool.Equipped:Connect(function()

Equip = true

Tool.Activated:Connect(function()

if Equip == true then

print('Noob') -- Supposed to return only once but returns more than once each click

end

end)

end)

  

  

Tool.Unequipped:Connect(function()

Equip = false

end)

4 comments

0

Depends on how long you're holding down the mouse button.

0

No Like its supposed to print "Noob" only once but it keeps printing it 2x 5x 100x depending on how many times i unequiped it

0

Why not try to change the debounce within the Activated event function instead of the Equipped/Unequipped functions? Or just create a second debounce?

0

you should use return and not print or use a wait function

1 answer

If you print the exact same string over and over, it'll add x1, x2, x3, etc to the end as a way to show how many times that string has been printed without your output being spammed with the same string over and over.

Also, it's because the Activated function is inside the Equipped function so those numbers will keep raising. Move the Activated function outside the Equipped function.

This discussion is preserved as it was. New answers, comments, and votes are closed.