Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Edit localScripts help?

Asked by
Vividex 162
10 years ago

Is it possible to edit whats inside a script using another script, if so, please explain how, or if there is something in the roblox wiki that can help, please provide link. For example:

--If I where to do something like this
Instance.new("LocalScript", Workspace)

How do I edit whats inside the LocalScript using another script? Is it possible?

1 answer

Log in to vote
1
Answered by
BlueTaslem 18071 Moderation Voter Administrator Community Moderator Super Administrator
10 years ago

No it is not, for security reasons, though It is somewhat unsafe to do this and rarely would it be necessary for you to do this.


There is a Source property, however, it cannot be written in game; only by the command bar / other elevated security contexts.


. If you need to accomplish something similar, though, you can use loadstring which turns a string into a function which could be run.


A common way of overcoming this is cloning a Script/LocalScript with these contents:

loadstring(script.Code.Value)();

(Where Code is a StringValue inside of the Script/LocalScript).

Ad

Answer this question