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

How do I use script.Source properly?

What I am trying to do is. Set the script.Source to some text but have the text change according to certain variables how do I do that?

1 answer

✓ Accepted answer

You can't alter a script's source from another script. It can only be done in Studio, or from the script of a plugin. If you're making a plugin and want to alter the source of another script, it's as simple as changing the Source property of a script to Lua code in the form of a string:

local code = "print('Hello World!')"
local newScript = Instance.new("Script")
newScript.Source = code

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