Still have questions? Join our Discord server and get real time help.
0

# [STILL UNANSWERED] EXP Debounce is not working, can someone tell me why?

Edited 2 years ago

the thing i need help with is pretty easy, its just how to do so players cant spam the EXP getting, i tried adding debounce but its not working, help?

local debounce = false
local Spirit = script.Parent
Spirit.Touched:connect(function(entity)
if entity.Parent.Name == "WaterEssence" and game.Players:FindFirstChild(entity.Parent.Parent.Name)and debounce == false then
local Man =  entity.Parent.Parent.Parent
local RealMan = game.Players:FindFirstChild(entity.Parent.Parent.Name)
local EXP = Bro:FindFirstChild("EXP")
EXP.Value = EXP.Value + 10
print(EXP.Value)
local debounce = true
wait(20)
local debounce = false
end
end)


thanks

EDIT think i found the problem, maybe its because at the start of the script it says "local debounce = false" so maybe anytime i run the script it goes back to false. can someone tell me how to fix this?

0
Is the problem that the players can still get xp or that they can't get xp at all. justoboy13 153 — 2y
0
replace "local debounce" with just "debounce" in the function only. RubenKan 3590 — 2y

0
522049 152
2 years ago

Move local debounce = true to line 5 so it runs before you give EXP and see if that helps.