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
|
  |
| Joined: 12 Jan 2009 |
| Total Posts: 969 |
|
|
| 21 Dec 2012 01:25 PM |
| Nvm, [[ ]] Means string anyway. xD |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|