Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Is there any way to edit a script using another script?

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?

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! :)

1 comment

0

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

This discussion is preserved as it was. New answers, comments, and votes are closed.