How to temporarily avoid a button to be clicked?
just delete or editout the MouseButton1Click function
So personally I would do this by using a variable lock. I’ll display what I mean:
local button = -- whatever/wherever your button is local disable = false -- this variable is what will lock the click function of the button button.MouseButton1Click:Connect(function() if disable then return end -- if disable is true then we immediately return from this function -- do stuff here end)
This is the basic format of what I would use, you can have the script set disable to true/false whenever you please.
Hope this helped!
There is everything you would need to undestand how to disable button in these websites.
Othewise you can just do a if statement like @bubbavimto proposed
Make the button’s visibility false.
button.Visible = false
Set the MaxActivationDistance to 0
If you wanted to be memory conscious you could disconnect the event and then reconnect it when necessary.
That’s what I’m doing.