generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Is there any way to modify a script?

Previous Thread :: Next Thread 
Mario5422 is not online. 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 is not online. 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
swimguy777 is not online. swimguy777
Joined: 30 May 2009
Total Posts: 17092
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
TheNewScripter is not online. TheNewScripter
Joined: 02 Mar 2010
Total Posts: 2432
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image