Hi, i took a ”regeneration button” from ToolBox, and i tried to add a Debounce thing, soo you cant spam that button, but i still cant get it right, can someone help?
location = script.Parent.Parent.Parent regen = script.Parent.Parent save = regen:clone() function onClicked() local back = save:clone() back.Parent = location back:MakeJoints() end script.Parent.ClickDetector.MouseClick:connect(onClicked)
location = script.Parent.Parent.Parent regen = script.Parent.Parent save = regen:clone() local Debounce = false function onClicked() if not Debounce then Debounce = true local back = save:clone() back.Parent = location back:MakeJoints() wait(1) Debounce = false end end script.Parent.ClickDetector.MouseClick:connect(onClicked)