Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Plugin GUI help?

Asked by
1N0body 206 Moderation Voter
10 years ago
Edited 8 years ago

How I am able to do a G.U.I. for my plugin which is active in the studio? Like example the animation editor from ROBLOX , a G.U.I appears where I can click the button and gives me the next frame. How I am supposed to do something like that? I searched evrywhere (including the wiki) but I didn't found it. Well, the normal way to do is to Insert a new Screen GUI in the StarterGui, but it's only for the game designing. Atleast an API for this kind of G.U.I.

3 answers

Log in to vote
4
Answered by 8 years ago

This is two years late but you would parent the GUI to the CoreGui so something like this

Gui.Parent = game.CoreGui

And to remove it you would just have to do set the Gui to a Variable

local Gui = script.Gui -- or wherever you put it
Gui.Parent = game.CoreGui
--Then when you want it to go away you'd simply do this 
Gui:Destroy()
1
Oh, well, I did found out by now, but thank you. 1N0body 206 — 8y
0
How can you make it so buttons in the gui are clickable? PoppyandNeivaarecute 134 — 4y
0
@tanoflame Thanks that was really helpful! Mr_Owlsss -2 — 4y
Ad
Log in to vote
0
Answered by
TofuBytes 500 Moderation Voter
10 years ago

Yes actually, there is RbxGui. It's a library you can use for making GUI interfaces for your plugins. Here's the wiki page: RbxGui

0
This won't work, it's also just for the PlayerGUI's 1N0body 206 — 10y
0
Tough I need more information, It only says I can use with the PLayerGUI, where I am supposed to put the plguin GUI? 1N0body 206 — 10y
Log in to vote
0
Answered by 7 years ago
Edited 7 years ago

Here is a simple trick I used in a lot of my plugins to add a gui:

1 Creating the toolbar

local toolbar = plugin:CreateToolbar("PutNameOfToolBarHere")

2 Adding a button

local toolbar = plugin:CreateToolbar("PutNameOfToolBarHere")

local button1 = toolbar:CreateButton(
    "PutNameOfButtonHere",
    "PutHoverLabelOfButtonHere", -- you dont need to
    "PutImageAssetIDHere" -- you dont need to
)

3 Giving the Button a Function #1

local toolbar = plugin:CreateToolbar("PutNameOfToolBarHere")

local button1 = toolbar:CreateButton(
    "PutNameOfButtonHere",
    "PutHoverLabelOfButtonHere", -- you dont need to
    "PutImageAssetIDHere" -- you dont need to
)

button.Click:connect(function()

end)

4 Adding some Variables

local plugin2 = script.Parent -- means that you should put this script under the plugin model
local gui = plugin2.GUINAME -- or wherever you put the gui

local toolbar = plugin:CreateToolbar("PutNameOfToolBarHere")

local button1 = toolbar:CreateButton(
    "PutNameOfButtonHere",
    "PutHoverLabelOfButtonHere", -- you dont need to
    "PutImageAssetIDHere" -- you dont need to
)

button.Click:connect(function()

end)

5 Getting CoreGui

local plugin2 = script.Parent -- means that you should put this script under the plugin model
local gui = plugin2.GUINAME -- or wherever you put the gui
local coregui = game:GetService("CoreGui") -- this is the simplest way

local toolbar = plugin:CreateToolbar("PutNameOfToolBarHere")

local button1 = toolbar:CreateButton(
    "PutNameOfButtonHere",
    "PutHoverLabelOfButtonHere", -- you dont need to
    "PutImageAssetIDHere" -- you dont need to
)

button.Click:connect(function()

end)

6 Giving the Button a Function #2

local plugin2 = script.Parent -- means that you should put this script under the plugin model
local gui = plugin2.GUINAME -- or wherever you put the gui
local coregui = game:GetService("CoreGui") -- this is the simplest way

local toolbar = plugin:CreateToolbar("PutNameOfToolBarHere")

local button1 = toolbar:CreateButton(
    "PutNameOfButtonHere",
    "PutHoverLabelOfButtonHere", -- you dont need to
    "PutImageAssetIDHere" -- you dont need to
)

button.Click:connect(function()
    gui:Clone.Parent = coregui -- clones the gui and that clone gui will be in core gui
end)

7 Connecting the plugin with the close button (this is the script in the close button in your gui)

local gui = script.Parent.Parent.Parent -- or wherever you put it

script.Parent.MouseButton1Click:connect(function()
  gui:Destroy() -- destroys the clone gui
end)

And you are finished! Hope you like it!

Works most likely in late 2017 - early 2018 (not sure in 2018)

Answer this question