I’m having trouble trying to make a script inside of a script (making a code in a script using another script)
I don’t know how to do this can someone help?
Do you mean “I want to run a string as code”, or “I want to Instance.new a script and change what it contains when you open it”?
I believe creating scripts what create scripts inside other scripts isn’t possible. It would be pretty useless in my opinion.
If I understood correctly, you’re trying to tell a script via a different script to change all or some of it’s values inside of it.
You can’t create scripts with code inside of them unless you’re making a plugin.
You can definitely share variables between scripts. There’s a thing called “Global variables.” Local variables are basically variables only inside that one script. Global variables can be used between all the scripts I believe.
So… you may put that in work if you’d like to do that.
You can have multiple scripts in and object.
Only plugin scripts and code ran through the command bar (or identities higher than or of those) can read and write to script.Source.
You can’t change a script’s source without a plugin, or the command bar, therefore, you can’t make scripts with another script, not used for a plugin.
Your best bet would be loadstring
honestly.
Aren’t loadstrings the sketchiest things in the world?
Weren’t they causing like more chances for exploiters to exploit?
Not unless your system is designed for it to become dangerous, It isn’t inherently bad - simply enabling the property and using it on the server is not dangerous.
no
If the server is not allowing clients to execute code through a remote you’re fine. Anyone that says enabling it alone is dangerous is misinformed or is just riding the “loadstring
bad!!” bandwagon
Anything can be bad if you make it unsafe.
how would i do this exactly? may I have some pointers?
Since you already know what the code is, just do
loadstring("print(1)")() -- this code is just an example
Loadstrings are only limited to the server
OP never said if they were using a local script or not, if this ends up being the case then oh well, or make a custom loadstring (more complex, although the only custom one i know is adonis’, so you could take a look at that)
alright thanks for helping me.