How can I disable a UI button?

There is no enabled property for a textbutton, the only way you can achieve this is by a custom solution, what you should do is make a variable in the script managing the button, which holds if the button is enabled, and check if the button is enabled before acting on any input. Right now there is no property that can completely sink input (GuiObject 'Enabled' property - a feature request made a long time ago). To make this easier to script only detect input using the input began event:

local TextButton = --some text button
local Enabled = true

TextButton.InputBegan:Connect(function(Input)
    if (not Enabled) then
        return
    end
    --detect other input events using Input.UserInputType
end)
3 Likes