I have no idea why it isn't working, here's 2 scripts.
Plugin script:
local loaded = plugin:GetSetting("pluginHasLoaded") local toolbar = plugin:CreateToolbar("Test") if not loaded then print("Hello!") end local button = toolbar:CreateButton( "Click me!", "Can you click me please?", "http://www.roblox.com/asset/?id=145723965" ) button.Click:connect(function() plugin:Activate(true) script.Parent.ScreenGui:Clone().Parent = game.CoreGui end)
GUI Button script:
function click() print("Clicked!") end script.Parent.MouseButton1Click:connect(click)
Can you help me please? :/
You need to have it all in one script.
for instance:
local gui = Instance.new("Gui", game.CoreGui) local frame1 = Instance.new("Frame", gui) frame1.Position = UDim2.new(50,0,50,0) local Button = Instance.new("TextButton", frame1) Button.Position = UDim2.new(frame1.Position)
Now under that you need to enter your functions
Button.MouseButton1Down:connect(function() -- Functions end)
This is just an example and positions, colors, size ect. won't be added.
Old question but it bothers me when the only reference to a problem I had, has no solution. I was able to resolve this issue by waiting for the GUI in core with:
game.CoreGui.ChildAdded:Connect(function(child) -- need to use WaitForChild as descendants may not have replicated yet --local head = child:WaitForChild("Head") --guiLocation.ClickerWindow.Frame.TextButton.MouseButton1Click:Connect(insertClickEvent) end)