i have a simple Onclicked function that i would like to prevent the button from working once the function is called. don't worry about the syntax i just want to know how to make the button not work or not call the function again while it is working. is this possible? and how could i achieve it if so?
function move() transport(finish) end floor1e.ClickDetector.MouseClick:connect(move)
The button can't be clicked if the MaxActivationDistance is null.
function move() transport(finish) floor1e.ClickDetector.MaxActivationDistance = 0 end floor1e.ClickDetector.MouseClick:connect(move)
An example of the disconnect
method suggested by Perci1.
local connection function move() transport(finish) connection:disconnect() end connection = floor1e.ClickDetector.MouseClick:connect(move)
function move() transport(finish) script.Disabled = true end floor1e.ClickDetector.MouseClick:connect(move)
Is this what you wanted?