I have a register handler that registers interactions with objects. e.g. you can press 'E' to open a door
I want to listen for the invoking script's Changed event so that I can disconnect the interaction when it changes...
Here's a short summary of my script :
local registerBindable = path.to.my.bindable.function
local function register(part, description, callback)
-- assign id, create remoteEvent for client interactions
local function disconnect()
-- disconnects all events e.g. the client interaction event
end
-- this wont work for a bindable function but worked in a moduleScript
-- I am using a normal Script now because my invoking scripts may re-execute
-- and it would result in multiple interactions and the old interactions wont work anymore
getfenv(2).script.Changed:Connect(disconnect)
end
registerBindable.OnInvoke = register
