Plugin GUI Script

So Im making a plugin. I have the ScreenGUI in CoreGUI and it enables if someone presses the button on the toolbar.

In the GUI, do I use a Local Script or a regular Script? Its not for the actual game, so I don’t know.

3 Likes

You would need to use a local script. local scripts allow you to do game.Players.LocalPlayer which you can’t to in a server script

1 Like

Its for a plugin. Why would I do game.Players.LocalPlayer?

1 Like

How would a server script be able to detect a button press coming from a client?

Good point. Should my plugin GUI be in CoreGUI or PluginGUI?

1 Like

I haven’t dabbled with plugins in a long while, so I never really looked into the whole PluginGui service, I would take a gander at the wiki and see how they do all of that.

2 Likes

You would do it in CoreGui :slight_smile: You can also detect input with a normal script, but only when its a plugin. I used a normal script for my GUI on this plugin, and I was able to detect all input. The Roblox wiki recommends using scripts and not local scripts for plugins.

https://gyazo.com/23e167179c80c8e12eda740fdc7b33cc

1 Like

But then how do I find who clicked?

1 Like

Its a property of the button? I have my GUI inside a folder in which the plugin script is also inside. I have the button as a variable and when some clicks it the button triggers the MouseButton1Click event. Are you trying to figure out when someone clicks the toolbar or a button inside your UI?

Im taking about the Button inside my UI.

Okay then a normal script can access it, if its inside CoreGui.

But only when doing it in a plugin, plugins have exceptions to things. A script inside a plugin can access CoreGui but it cannot access PlayerGui, because PlayerGui doesnt exist until the game is started and when a game starts the plugin gets closed.

A normal script should work fine :slight_smile:

1 Like

can I have a link to that plugin?

1 Like

Its not finished yet haha. Ive got lots to add and such.

1 Like