TextButton.Debounce

Nearly every TextButton and ImageButton in Roblox uses some kind of debounce. Adding a new number property to TextButtons and ImageButtons called ‘Debounce’ would be a very convenient thing to have and would speed up workflow

local TextButton = Instance.new("TextButton")
TextButton.Debounce = 0.2
TextButton.Parent = SomeFrame

local LastClick = 0
TextButton.Activated:Connect(function()
    print((tick() - LastClick) .. " since last click") --This would never be lower than 0.2 because TextButton.Debounce = 0.2
    LastClick = tick()
end)
15 Likes