How To Manage Attribute Changes In A Function?

I was wondering if there’s a way to only listen for a attributechange using .AttributeChanged or :GetAttributeChangedSignal only when a function is currently running and not to run when the function isn’t running…

1 Like
local connection = Object:GetAttributeChangedSignal("name"):Connect(function()
	--your code
end)
--when the function stops running:
connection:Disconnect()

thanks i forgot about connection and its uses with functions.

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