Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
2

How would I be able to create a script with code placed in it?

Asked by
uhTeddy 101
6 years ago

This has been a question I wanted to know the answer for, I see plugins do it all the time. I know it is possible but all "Scripting Helpers" answers I have seen so far on various Question is a StringValue and using its value to loadstring(), though when you are using a plugin (like I want to create) you want it to be able to open the script with the code in it, not in a StringValue. Please help if you can.

1 answer

Log in to vote
1
Answered by
cabbler 1942 Moderation Voter
6 years ago

Since plugins are studio-only and assumed to be trusted there are few restrictions. All you have to do is search the api.

Create and open script:

local scr = Instance.new("LocalScript",game.StarterGui)
scr.Source = "test"
plugin:OpenScript(scr,1)
0
Thanks! uhTeddy 101 — 6y
Ad

Answer this question