im making a plugin, its suppose to be able to set new scripts that are made to stuff
it works but i have to reload to script to see it
local function set(part:Instance)
if enabled then
check()
if part:IsA("Script") then
if ScriptDefault then
part.Source = ScriptDefault
end
elseif part:IsA("LocalScript") then
if LScriptDefault then
part.Source = LScriptDefault
end
elseif part:IsA("ModuleScript") then
if MScriptDefault then
part.Source = MScriptDefault
end
end
end
end
button.Click:Connect(enable)
game.DescendantAdded:Connect(set)
whats wrong with it?