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

Roblox Plugin Issue? Its my first time making a Plugin.

Asked by 5 years ago

Hello! So i am new to making Plugins. In fact I've just started. I've read through the Roblox Wiki page. I am trying to make a simple plugin when you click it it shows a frame. This script keeps giving me errors. Could anyone help? Thanks in advance. Code is below.

print("Loading Core Processes")

-- Check if user has loaded plugin before
local hasLoaded = plugin:GetSetting("pluginHasLoaded")
if not hasLoaded then
    print("Welcome Plugin is now Loading")
    plugin:SetSetting("pluginHasLoaded", true)
end


local toolbar = plugin:CreateToolbar("Us3r's Plugins")


local button = toolbar:CreateButton(
    "Button",
    "Press me",
    "http://www.roblox.com/asset/?id=145723965"
)
button.Click:connect(function()
    print("Plugin is now active")
    plugin:Activate(true) 
end)

local GUI = Instance.new("ScreenGui")
GUI.Parent = game.CoreGui
local frame = game.CoreGui.GUI
frame.Name = MainFrame
frame.Size = ({0, 129}{0, 194})
frame.Position = {0.421, 0},{0.256, 0}




print("Finished Loading Shop Plugin Test")

Error ***Expected ')' (to close '(' at column 14), got '(' ***

0
lines 28 and 29 are not valid syntax. what you want is UDim2.new(0, 129, 0, 194) and UDim2.new(0.421, 0, 0.256, 0) 1waffle1 2908 — 5y
0
If variable 'frame' is supposed to be a Frame then that entire part is wrong. xPolarium 1388 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

You forgot to create the Frame and add UDim2.new, frame.Parent = GUI

print("Loading Core Processes")

-- Check if user has loaded plugin before
local hasLoaded = plugin:GetSetting("pluginHasLoaded")
if not hasLoaded then
    print("Welcome Plugin is now Loading")
    plugin:SetSetting("pluginHasLoaded", true)
end


local toolbar = plugin:CreateToolbar("Us3r's Plugins")


local button = toolbar:CreateButton(
    "Button",
    "Press me",
    "http://www.roblox.com/asset/?id=145723965"
)
button.Click:connect(function()
    print("Plugin is now active")
    plugin:Activate(true) 
end)

local GUI = Instance.new("ScreenGui")
GUI.Parent = game.CoreGui

local frame = Instance.new("Frame")

frame.Name = "MainFrame"
frame.Size =  UDim2.new(0, 129,0, 194)
frame.Position =  UDim2.new(0.421, 0,0.256, 0)

--frame.Parent = game.CoreGui.GUI -- Parenting it to GUI?
-- you can it this way
frame.Parent = GUI



print("Finished Loading Shop Plugin Test")


Ad

Answer this question