Top posting users this month | |
Latest topics | » Where to go from here.September 14th 2020, 1:20 pm by MrNicNac» Send me an EmailSeptember 14th 2020, 1:16 pm by MrNicNac» [v1.6.0.0] Lua Script Obfuscator [No Bytecode]July 6th 2015, 7:38 pm by m27frogy» New Site PossiblyJuly 6th 2015, 4:16 pm by m27frogy» Ambassador!April 15th 2015, 11:40 pm by naknak» Boop - TagApril 13th 2015, 9:46 pm by naknak» Vip Class ScriptApril 13th 2015, 4:54 pm by naknak» Who's active?!April 13th 2015, 4:52 pm by naknak» Genesis PointJuly 17th 2014, 7:04 pm by branefreez» Reward SystemJuly 17th 2014, 5:41 am by m27frogy» Script RequestJuly 10th 2014, 11:43 am by naknak» local scripts?July 10th 2014, 11:39 am by naknak» Project: Reconstruction [Died]July 10th 2014, 11:36 am by naknak» Hi. I am new hereApril 26th 2014, 4:01 pm by altshiftkey» What's your favorite sport?January 1st 2014, 2:13 pm by m27frogy» FlashLight ScriptJanuary 1st 2014, 2:11 pm by m27frogy» Gun Making! [READ DESC]January 1st 2014, 2:10 pm by m27frogy» Hi, I am new here!November 26th 2013, 3:33 pm by Keanu73» Improve CodingOctober 26th 2013, 1:12 pm by pook03» Simple ButtonSeptember 1st 2013, 6:19 pm by branefreez |
|
| Scripting style | |
| | Author | Message |
---|
myrco919 Intermediate Scripter
Posts : 190 Join date : 2011-01-21 Age : 26 Location : Holland
| Subject: Scripting style December 31st 2011, 8:40 am | |
| This thread was made to give you a basic scripting style to make your scripts more readable and look nicer, of course you can bend some twicks and add some twicks, but that's upon you. Notice that some could eventualy be added. A scripting style is a very good way of making scripting more fun and making your scripts look better and more readable. - Tab scopes. (I'll explain what a scope is under the 'rules')
- Make readable maths by pressing space before and after the operator: 9*5+8=53 ---> 9 * 5 + 8 = 53. It doesn't only count for maths, but for all the operators: x=1 ---> x = 1 and if x==1 then ---> if x == 1 then
- Press space once after a comma: for x = 1,2,0.1 do ---> for x = 1, 2, 0.1 do (notice how I used the 'readable maths' rule at x = 1, because '=' is a operator)
- Define all your variables with 'local' unless you don't need a local variable. Also define all your variables you could define before the big work.
Congratulations, you've learned the basics for writing readable scripts.Now I want to explain what a scope is to you, but I'm a bit lazy o_o, so it'll be better to read this: http://wiki.roblox.com/index.php/ScopeIf you got any questions, post them bellow. | |
| | | Supernapalm Expert Scripter
Posts : 393 Join date : 2011-01-17
| Subject: Re: Scripting style January 4th 2012, 8:40 pm | |
| good, but uuuh, you got one thing wrong. local variables, as a matter of fact, are faster to access than global variables. so its actually better to sacrifice readability for speed | |
| | | blueymaddog Administrator
Posts : 1081 Join date : 2010-12-09 Age : 26
| Subject: Re: Scripting style February 4th 2012, 8:00 am | |
| @super, I'm guessing you found that out from Oysi like I did? :3 | |
| | | Sponsored content
| Subject: Re: Scripting style | |
| |
| | | | Scripting style | |
|
Similar topics | |
|
| Permissions in this forum: | You cannot reply to topics in this forum
| |
| |
| Who is online? | In total there are 4 users online :: 0 Registered, 0 Hidden and 4 Guests
None
Most users ever online was 136 on October 21st 2024, 12:16 pm
|
| Please tell us what time zone you are in here
Got a really good idea? Post it in projects and it might show up here! |
|