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

How do I make a gui for a plugin work?

Asked by
wazap 100
9 years ago

I'm trying to make a plugin. However, the wiki tutorial for plugins aren't providing information on how I can manipulate guis for plugin purposes.

I would like an example, a very simple one, say, if I click a textbutton, the plugin script prints out 2. Thank you.

0
I'd imagine you'd put the GUIs in the 'CoreGui' service, but that's just my guess. TheeDeathCaster 2368 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

Heres an example :) Just put the gui stuff in CoreGui

local Plugin = PluginManager():CreatePlugin()
local Toolbar = Plugin:CreateToolbar("MyToolbar")
local Button = Toolbar:CreateButton("MyButton","This is my button","")


function Activate()
    Button:SetActive(true)
    local gui = Instance.new("ScreenGui", game:GetService("CoreGui"))
    local frame = Instance.new("Frame")
    frame.Size = UDim2.new(0.1, 0, 0.1, 0)
    frame.Position = UDim2.new(0.3, 0, 0.3, 0)
end


local active = false
Button.Click:connect(function()
    active = not active
    if active then
        Plugin:Activate(true)
        Activate()
    else
        Button:SetActive(false)
    end
end)

Ad

Answer this question