Mario5422
|
  |
| Joined: 17 Nov 2008 |
| Total Posts: 3922 |
|
|
| 20 Jun 2014 11:35 PM |
I really don't think so, but I wanted to ask this anyway...
Is there any way that you can change a CERTAIN line of code in a script with another script?
Thanks |
|
|
| Report Abuse |
|
KEVEKEV77
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
|
| 20 Jun 2014 11:36 PM |
Try load string. Pretty sure you can't change, only make. |
|
|
| Report Abuse |
|
|
| 20 Jun 2014 11:37 PM |
Not possible. You can't access the source of a script with another script
-[::ƧѡÎḾḠΰῩ::]-[::Helper of Scripting and Writer of Wikis::] |
|
|
| Report Abuse |
|
|
| 20 Jun 2014 11:41 PM |
Well you can't change another script's source, but if you use loadstring like Kevek said, then you can technically change it.
local source = [==[print 'Hello, world!' print 'Goodbye, world!']==] function runCode() local func, output = loadstring(source, "ModifiedCode") if func ~= nil then local successful, err = ypcall(func) if not successful then print(err) end end end runCode() source = "print 'Hello, world!'" runCode()
Or you could just use basic string manipulation to change stuff. But yeah, using that, you can run any code and get the error message if there is any. |
|
|
| Report Abuse |
|