Using plugin:Activate(true) in a plugin will also fire the plugin.Deactivation event.
Attached is an example plugin script. It is a model with a script contained within. The code is shown below:
assert(plugin, "Invalid permissions")
plugin.Deactivation:connect(function ()
print("Derp: Deactivated")
end)
toolbar = plugin:CreateToolbar("Test")
button = toolbar:CreateButton("Test", "", "")
button.Click:connect(function ()
print("Derp: Activating...")
plugin:Activate(true)
print("Derp: Done")
end)
When you press the button “Test”, the following is printed in the output:
Derp: Activating...
Derp: Deactivated
Derp: Done
As you can tell, by simply activating the plugin the same plugin gets the Deactivation event fired. I have tested this without any other plugins running on studio (except the terrain ones included by default).
I’m 99% sure I’m not doing anything wrong in the code. Please try and reproduce this. To ROBLOX - is this intended behavior? Or just a bug? This wasn’t an issue with the old plugin system.