Need Plugin Help

Hello, so I am making my first ever plugin and I am stuck on something

When I press the buttons on the gui (which open when pressing on the plugin button) They just add in a script. They are supposed to add scripts with preset code inside them
How can I do this

local toolbar = plugin:CreateToolbar("EZBadgeScript") 
local newScriptButton = toolbar:CreateButton("Create Badge Scripts", "Makes Simple Badge scripts", "rbxassetid://7577357898") -
local materials = Enum.Material:GetEnumItems()
local Camera = workspace.CurrentCamera
newScriptButton.Click:Connect(function()
	if script:FindFirstChild("UI") then
		script.UI.Parent = game:WaitForChild("CoreGui")
		game.CoreGui:WaitForChild("UI").ImageLabel.TextButton1.MouseButton1Click:connect(function()
			local squip = Instance.new("Script") 
			squip.Parent = game.Workspace
		end)
	else
		game.CoreGui:WaitForChild("UI").Parent = script 
	end
end)

Thank you for checking this out, and if you chose to help, you are a nice person
Have a good day

also, this code was not made by me, I just edited it

if you need to see other things just tell me

1 Like

edit it with the Source property

local squip = Instance.new("Script") 
squip.Source = [[--!strict
print("This is my script!")
]]
squip.Parent = game.Workspace
1 Like

What do you mean by that?

Edit: do you mean line 6 and 7?

1 Like

Nvm I was wrong

Summary

This text will be hidden

2 Likes

thanks you really helped me a lot

I now can make my first plugin

2 Likes