You would have to create a ModuleScript with the code you want, publish it to the website, and make it public. Then from a server script, use the require function with the published ModuleScript’s AssetId.
--example
local module = require(56864785)
Another way to load scripts at runtime would be to use the loadstring function. In order to use it, you’d need to enable the property under ServerScriptService. loadstring also only works on the server:
The only way to achieve that would be using InsertService for a published script and insert it into the game. The downside of this is that the model needs to be either uploaded by Roblox or owned by the game creator.
You can’t change the source code of any pre-created scripts unless you’re using a PluginScript, but those only run in studio
but it creates an empty model named ToolboxTemporaryInsertModel, it automatically creates that model when you insert a free model that contains scripts