Plugin:Activate(true) firing plugin.Deactivation

I was having some issues with my plugin, so after adding in a couple debug print messages into the plugin, I found this in the output:

Deactivated

Here’s the basic rundown of how the plugin works: You click the button, and it activates the plugin – it shouldn’t be getting deactivated:

local plugin = plugin
local toolbar = plugin:CreateToolbar("Build")
local mouse,activeTool
local toolbarButtons = {
    select = toolbar:CreateButton(
        "Select_BUILD",
        "Select an object",
        "rbxassetid://248473961"
    );
}

plugin.Deactivation:connect(function() 
    print("Deactivated")
end)

toolbarButtons.select.Click:connect(function()
    plugin:Activate(true)
end)

The only explanation is that plugin.Deactivation is getting fired when plugin:Activate(true) is executed – that should not be happening at all. Please fix.

1 Like

There are many problems with plugins, most of which I’ve outlined here over a year ago:

It would be great if the interest in fixing these problems could be revived.

[quote] There are many problems with plugins, most of which I’ve outlined here over a year ago:

It would be great if the interest in fixing these problems could be revived. [/quote]

Oh, that’s a nice list! Unfortunately, we’re really busy with our current projects, but you aren’t forgotten!

You can actually just use the ContextActionService as an alternative to the Plugin’s mouse.
BindAction will still work even while the game isn’t running.

It’s sad to say but 2.5 years (851 days) later this is still a bug.

4 Likes