Bindable and remote functions unbinding

So basically I would want to unbind the function that’s binded to it already. Here’s an example script:

 Game.ReplicatedStorage.BindableFunction.OnInvoke = function(variable)
    return tostring(variable)

keep in mind that an example script.

I would want to delete the script when an event happens because Im trying to stop the script from doing anything when an even runs. But if I do that and clone the script and try to add the function again it says this:

So is there any way I can unbind the function and rebind it when I clone the script? I haven’t tried setting it to nil but I will see if that works. If you guys have any other ideas all help is appreciated. Just comment!

You could have a true/false variable. In the event, set it to true/false. In the function, check if it is true/false.

1 Like

Try setting the callback to nil before destroying the script? Still, @COUNTYL1MITS’s implementation suggestion is a more robust than destroying the scripts.