I am wondering if you can edit a script by using other scripts: Like to change the script's code with the help of another script?
COMMUNITY QUESTION
Is there any way to edit a script using another script?
1 answer
Yes. Every script has a Source property which is the code that it contains.
local aScript = workspace:WaitForChild("Script1")
local otherScript = workspace:WaitForChild("Script2")
otherScript.Source = aScript.Source
The above code will set one of the script's code to the content of the other script.
Hope this helps! :)
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
You cant access a scripts source code and edit it with another script while the game is running.