|
| 08 Oct 2016 01:37 AM |
in a lot of long scripts i find:
do --code end
does this have any purpose
|
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 08 Oct 2016 01:39 AM |
| Mainly it's for organizational purposes, but it can also allow the reuse of local variables (but typically this is not the reason why people usually use it). |
|
|
| Report Abuse |
|
|
|
| 08 Oct 2016 01:43 AM |
i found one part of code where the coder did this:
do do do --code end end end
no idea why
|
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 08 Oct 2016 01:43 AM |
| That's probably just a troll doing that |
|
|
| Report Abuse |
|
|
|
| 08 Oct 2016 01:44 AM |
i'm looking at scripts from a stolen game to learn things, i don't think it's a troll
|
|
|
| Report Abuse |
|
|
JoshRBX
|
  |
| Joined: 19 May 2012 |
| Total Posts: 8778 |
|
|
| 08 Oct 2016 02:01 AM |
| i don't think you'll ever need to use that |
|
|
| Report Abuse |
|
|
DevVince
|
  |
| Joined: 08 Nov 2008 |
| Total Posts: 9245 |
|
|
| 08 Oct 2016 02:16 AM |
| Their just a bad scripter. |
|
|
| Report Abuse |
|
|
|
| 08 Oct 2016 02:25 AM |
"i don't think you'll ever need to use that" i don't think you should be alive
"Their just a bad scripter." you are just a bad scripter |
|
|
| Report Abuse |
|
|
Kervos
|
  |
| Joined: 27 Aug 2015 |
| Total Posts: 322 |
|
|
| 08 Oct 2016 02:29 AM |
someone is feeling edgy today
|
|
|
| Report Abuse |
|
|
DevVince
|
  |
| Joined: 08 Nov 2008 |
| Total Posts: 9245 |
|
|
| 08 Oct 2016 02:50 AM |
I guess mr nub thinks:
do do do --code end end end
Is good to do... xD Maybe that's why his name contains nub. x) |
|
|
| Report Abuse |
|
|
|
| 08 Oct 2016 03:14 AM |
"do --code end"
Is used in most cases in this sense to make it appear cleaner/ easier to navigate once the script gets too large to get managed and you have to use collapse all folds to get around. That is what most older scripts provide insight to/on.
#code Signature_mod = require(DataModel['sm_Data']) if Signature_mod['xThe..']['RbxDev_Info'] ~= 'Too Lazy To Try Again After A Year' then print('You finally did it lol') end |
|
|
| Report Abuse |
|
|
|
| 08 Oct 2016 03:16 AM |
Basically what cnt said.
#code Signature_mod = require(DataModel['sm_Data']) if Signature_mod['xThe..']['RbxDev_Info'] ~= 'Too Lazy To Try Again After A Year' then print('You finally did it lol') end |
|
|
| Report Abuse |
|
|
|
| 08 Oct 2016 03:47 AM |
| i guess devvince thinks he knows lua |
|
|
| Report Abuse |
|
|
|
| 08 Oct 2016 04:26 AM |
Its for reusing local statements like cnt said --code local x=3 local y=2 do local x = 1 print(x+y) end print(x+y) --code |
|
|
| Report Abuse |
|
|
|
| 08 Oct 2016 04:32 AM |
I haven't been here for a while... Sadistic is apparently the new troll that tries to confused newbies? It's about time, we'd been without one for nearly a week.
|
|
|
| Report Abuse |
|
|
| |
|