In order to do this you'll need a plugin. I don't know much about plugins, but this should do what you want. Put this inside a regular script in server script service:
local ChangeHistoryService = game:GetService("ChangeHistoryService")
local toolbar = plugin:CreateToolbar("Custom Script Tools")
local newScriptButton = toolbar:CreateButton("Create Require Script", "Create a script without print(HelloWorld!)", "rbxassetid://4458901886")
local function onNewScriptButtonClicked()
local newScript = Instance.new("Script")
newScript.Source = "local inspect = require(script.Parent.inspect)"
newScript.Parent = game:GetService("ServerScriptService")
ChangeHistoryService:SetWaypoint("Added new empty script")
end
newScriptButton.Click:Connect(onNewScriptButtonClicked)
When you've finished writing the script, right click the script in the explorer and select Save as Local Plugin. This will save the plugin to your computer, and the button should appear in the plugins tab of studio. If it doesn't, push the "Plugins Folder" button on the left side of the plugins tab and upload the plugin from your computer. Also, when you're making your script, "plugin" might get underlined as an error, but this is normal it will still work perfectly fine.
Plugins can get pretty complicated, so if you want something more than this, I would recommend checking out some plugin-making tutorials, because this is about the limit of my plugin knowledge. I hope this works!
3 comments
Maybe try forking it..? I'm not sure what you mean.
I reworded it so it's easier to understand now. should have put more effort into legibility in the first place sorry.
I hope this receives an answer that will override default functionality.