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

Is it possible to disable a button?

Asked by
Codebot 85
9 years ago

Is it possible to make a TextButton not "clickable" so that the user cant just keep clicking it and the function doesn't run?

1 answer

Log in to vote
1
Answered by
Lacryma 548 Moderation Voter
9 years ago

You can use a debounce or change the Active property of the textbutton to false.

Example of debounce for clicking:

local clicked = false

button.MouseButton1Down:connect(function()
    if not clicked then
        clicked = true
        -- rest of the code
        clicked = false
    end
end)
Ad

Answer this question