I was looking to try making a plugin for myself because I have no idea how they work, and thought this would be a good example.
local SES = game:GetService("ScriptEditorService")
local toolbar = plugin:CreateToolbar("Nerd Script Helper")
local NewButton = toolbar:CreateButton("🤓", "owo", "http://www.roblox.com/asset/?id=10218508810")
NewButton.Click:Connect(function()
for i, v in ipairs(game:GetDescendants()) do
if v:IsA("Script") then
v:GetPropertyChangedSignal("Source"):Connect(function()
print(v.Source)
end)
end
end
end)
I was looking to make it detect a possible error, but I didn’t know how to do it.
Do you mean find an error in another script, before running the other script? Loadstring, without calling the returned function, is probably the only way.
local SES = game:GetService("ScriptEditorService")
local toolbar = plugin:CreateToolbar("Nerd Script Helper")
local NewButton = toolbar:CreateButton("🤓", "owo", "http://www.roblox.com/asset/?id=10218508810")
NewButton.Click:Connect(function()
for i, v in ipairs(game:GetDescendants()) do
if v:IsA("Script") or v:IsA("LocalScript") then
v:GetPropertyChangedSignal("Source"):Connect(function()
local succ, err = pcall(function()
loadstring(v.Source)
end)
if not succ then warn(err) end
end)
end
end
end)
You require it from the script, and use the variable from the module you just required as a function, specifying the string to load and the environment.