Changing Scripts with a script?

Hey Devs!

I was just curious if I have a script in workspace, is there a way that with another script, I can change the scripts inside of it? I am not sure if it would have any practical use, I am just curious!

Thank you!

1 Like

To do that, you could do script.Source, but it only works from plugins (and I think the command bar).

Yikes. Now seeing that plugins can do that it makes plugin viruses even scarier :stuck_out_tongue:

1 Like

-translate this-
en mi experiencia como programador no hay forma de que puedas cambiar un script con otro script (sin importar si es global, local o de modulo)
pero hay algo parecido (realmente no xd)
puedes hacer un script con un StringValue o con un atributo (obiamente que este en string)
y con loadString() puedes hacer que corra como uno
ej:

local milanesa = 'print("hello world!")'
loadstring(tostring(milanesa))()
2 Likes