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: Script.source (Plugins)

Previous Thread :: Next Thread 
Monkey727 is not online. Monkey727
Joined: 12 Jan 2009
Total Posts: 969
21 Dec 2012 01:22 PM
If I wish to edit the source of a plugin, How could I go about doing this, Like I want to do:

script.Source = script.Source .. " Instance.new("Part") "

Can I do that though, I don't know if a string is the right thing to be using?

I've heard that
script.Source = [[ Code ]] works, However could I concatenate to that like in the script above.
Report Abuse
Monkey727 is not online. Monkey727
Joined: 12 Jan 2009
Total Posts: 969
21 Dec 2012 01:25 PM
Nvm, [[ ]] Means string anyway. xD
Report Abuse
FreeToTake is not online. FreeToTake
Joined: 21 Apr 2010
Total Posts: 1827
21 Dec 2012 01:26 PM
No, you can't edit the source of a script.
Create a script with just script.X.Changed:connect(function() loadstring(script.X.Value)() end)
so it would execute X.Value. Now you just instance a stringvalue in the script called 'X'.
To change the scripts source (indirectly) you should just change X.Value.
Report Abuse
Monkey727 is not online. Monkey727
Joined: 12 Jan 2009
Total Posts: 969
21 Dec 2012 01:32 PM
I'm talking about in Plugins, I've seen people edit them before so I know it is possible.
Report Abuse
Christbru01 is not online. Christbru01
Joined: 03 Apr 2010
Total Posts: 649
21 Dec 2012 01:32 PM
I think you can with Plugins/command bar, because normal scripts don't have the security clearence to do so, as far as concatnation, try embedding them in a pair of () so that the script does that firs, before altering the script's context/source
Report Abuse
RenderSettings is not online. RenderSettings
Joined: 16 Aug 2010
Total Posts: 2560
21 Dec 2012 01:39 PM
script.Source=script.Source..[[ Instance.new("Part")]]
note that if you want to use [[]]'s inside that, you have to use [==[]==]
Report Abuse
crazyman32 is online. crazyman32
Joined: 13 Apr 2008
Total Posts: 18027
21 Dec 2012 02:20 PM
script.Source is just a String of the sourcecode.

Therefore, whatever you can do to a string, you can do to that.
Report Abuse
AbsoluteLOL is not online. AbsoluteLOL
Joined: 01 Dec 2012
Total Posts: 3939
21 Dec 2012 02:27 PM
I didn't even know Plugins had the clearance to edit Source. That means, I can actually make a WORKING Visual Studio-style Syntax Checker...
Or at least I can try to.
Report Abuse
crazyman32 is online. crazyman32
Joined: 13 Apr 2008
Total Posts: 18027
21 Dec 2012 07:17 PM
Kinda...I tried that. Problem: It only updates the actual Source property when you exit the script or save the game.

However, when you do that, you can check for syntax stuff. I have one that does it automatically for me like that. Helps me avoid a ton of small naggy little bugs.
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