Is there a way to disconnect game:BindToClose()?

Was wondering if there was a way to disconnect game:BindToClose()

And in my case I cannot just have a variable and check if its true during the bindtoclose function. I need to be able to disconnect it. Ty in advance for any help

I just realized I can have a boolvalue and set it to true on bindtoclose then setup a changed event to that bool value and disconnect it as I wish.

local EventGoal = game:BindToClose
wait(5)
EventGoal:Disconncect()


1 Like

Does disconnect work on bindtoclose? I didnt know that.

It should work on any RBXScriptSignal

to check if it is, do this:

local eventGoal = game:BindToClose() --whatever idk
if typeof(eventGoal) == "RBXScriptSignal" then
   print("Yeah it is")
   event:Disconnect()
end

1 Like

That doesn’t work. DataModel.BindToClose is a function/method, not a signal.

Also, doing:

local EventGoal = game:BindToClose

is a syntax error

3 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.