Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

how to insert script with code in it through plugin?

i wanna make plugin that inserts script in serverscriptservice. but i don't know how to make script filled with my code. theres way to make it?

1 answer

✓ Accepted answer

After adding the script to ServerScriptService, you can have the plugin edit the script's Source property. Simply set the Source to a string containing your code:

local newScript = Instance.new("Script", game.ServerScriptService)
local code = "print('Hello World!')"
newScript.Source = code

2 comments

0

but it says it has not the permision to do that

0

You can't do it from a regular script, only from a plugin. If you upload the script as a plugin it will have permission.

This discussion is preserved as it was. New answers, comments, and votes are closed.