Hello! So is there a way to make a script that creates a script with a script inside of it? This sounds pretty confusing but what I want to do is something like that:
For example you click on an object and then a GUI pops up. You can type a script into that GUI. After pressing done, a new script will get created with the script that you’ve typed into that GUI.
I thought I had to do something like
local s = Instance.new("Script", game.ServerScriptService)
s.Source = textLabel.Text --the script that the player has typed in
but that doesn’t work. It keeps erroring: The current identity (2) cannot Source (lacking permission 1)
No. You can only use the Source property of a script through the command bar or through plugins. If you really wanted this though, you can go to the properties of ServerScriptService and turn on LoadStringEnabled. The loadstring method can only be used on the server, unfortunately. This means you will need a RemoteEvent if you’re making a script builder.
This is generally frowned upon since it can allow exploiters to execute arbitrary code on the server.
@WishingTie09120 clients get bytecode form local scripts and modules so they can decompile them anyway.
There are other ways that you can use loadstring though without needing to enable LoadStringEnabled, If you want to know about it you can reply to this or contact me on my discord. ryan10197#0691