THIS IS SOLLLVVVEDDDD!!!!!!!!
So I remember a way that you could make a new script within a script and could make the new script have code in it.
It was something like this:
1 | local script = Instance.new( "Script" ) |
2 |
3 | script. I DONT KNOW WHAT TO PUT HERE = [[ |
4 |
5 | print("Hello world!") |
6 | -- You could put a whole script in here. |
7 |
8 | ]] |
1 | Instance.new( "Script" ,game.Workspace).Source = "print(\"Hello World! v2\")" |
Although script.Source is locked so this method would not work.
Perhaps have the script pre made in ServerStorage and then clone it?
Here try this. I do not promise anything
1 | script = Instance.new( "Script" , workspace) |
2 | code = Instance.new( "StringValue" , script) |
3 | code.Value = "InsertScriptHere" |
4 | loadstring (code.Value)() |
That loads the code's value as a script. If you have a string?
1 | script = Instance.new( "Script" , workspace) |
2 | code = Instance.new( "StringValue" , script) |
3 | code.Value = "print('Hai')" |
4 | loadstring (code.Value)() |
Note: I didn't put " because that'd error it. I put an ' so then it doesn't mess with the string it is in.