My plugin script works but it inserts something when I join studio?
Here is the code I have
I made a plugin and for some reason the loader is inserting when I start studio when only the require script is suppost to when a button is pressed can you help?
02 | print ( "REG Loader Plugin loaded" ) |
06 | local toolbar = plugin:CreateToolbar( "REG Plugins" ) |
13 | local button = toolbar:CreateButton( |
15 | "Inserts REG Lea into your game" , |
19 | if game.StarterGui:FindFirstChild( "Loader" ) ~ = nil then |
20 | game.StarterGui.Loader:Destroy() |
26 | button.Click:connect( function () |
27 | if game.StarterGui:FindFirstChild( "Loader" ) ~ = nil then |
28 | game.StarterGui.Loader:Destroy() |
32 | q = game.ServerScriptService:FindFirstChild( "REG Lea | Loader" ) |
34 | t = script.Parent. error :Clone() |
35 | t.Parent = game.CoreGui |
37 | plugin:Activate( false ) |
42 | local h = script.Parent.Lo:Clone() |
43 | h.Name = "REG Lea | Loader" |
44 | h.Parent = game.ServerScriptService |
45 | b = script.Parent.success:Clone() |
46 | b.Parent = game.CoreGui |
48 | plugin:Activate( false ) |
It works but for some reason every time I try to enter studio it inserts the loader that is required within the script that is suppost to be inserted into ServerScriptService
Link to Plugin: https://www.roblox.com/library/852931945/REG-Loader-Insert
Please help!