Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 5 years ago

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)
0
Depends on how long you're holding down the mouse button. DeceptiveCaster 3761 — 5y
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 L0cal_Scr1pt 34 — 5y
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? DeceptiveCaster 3761 — 5y
0
you should use return and not print or use a wait function VVickedDev 54 — 5y

1 answer

Log in to vote
1
Answered by
Kymaraaa 116
5 years ago
Edited 5 years ago

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.

Ad

Answer this question