local hum = script.Parent.Parent.ShopOwner.Humanoid
local anim = hum:LoadAnimation(script.Parent.Parent.ShopOwner.WaveAnim)
function onTouch(part)
local humanoid = part.Parent:FindFirstChild("Humanoid")
anim:Play()
end
script.Parent.Touched:connect(onTouch)
COMMUNITY QUESTION
The Humanoid keeps waving and it doesn't stop. How do i create a debounce?
1 answer
local hum = script.Parent.Parent.ShopOwner.Humanoid
local db = true
local amountOFdbSECS = 3 --change it to the amount you want
local anim = hum:LoadAnimation(script.Parent.Parent.ShopOwner.WaveAnim)
function onTouch(part)
if db == true then
db = false
local humanoid = part.Parent:FindFirstChild("Humanoid")
anim:Play()
end
wait(amountOFdbSECS)
db = true
end
script.Parent.Touched:Connect(onTouch)
This discussion is preserved as it was. New answers, comments, and votes are closed.

6 comments
why did you use a variable and not just a number
that's completely unnecessary
yuuuuuppppp
yuupp ikr
@MCAndRobloxUnited because I can. Ik it is useless but I want him to get the point.
^^^