Plugin is nil. (LocalScript)

Old details for nil plugin

Hi there, I have a plugin. I use local scripts for some parts like cameras and such since I am using viewport frames. But I can’t use plugin:GetMouse() since plugin is nil. But I am exporting the plugin and it shouldn’t be nil. I have a normal script that makes the plugin button and everything. Is there a way to avoid having to put everything in one script? I’m pretty sure this is only because of the use of plugin.

Another problem has shown itself, the old one get fixed (I added a wait before the script). plugin:GetMouse().Button1Down doesn’t work. I don’t know if this is because of the slight deprecation
of the Button1Down feature but it just doesn’t work.

plugin is used only in plugin scripts
for a local script, you need to get the mouse using game.Players.LocalPlayer:GetMouse()

I am using a plugin script. Don’t worry, I used userinputservice. The problem is fixed now.

1 Like

Is it activated?

Uh. I did SetActive in the script. Does that count?

If I am not wrong that is a method for a button and not the plugin itself. I do not know what :SetActive does but I guess it is meant to enable and disable the button. So the only way to activate the plugin is through :Activate