Friday, December 3, 2010

Day One: It's Lua, not LUA.

Well my first day actually went well! I am using the tutorial at wiki.garrysmod.com (Tutorial link Click Here) and it's really easy to read and understand. When I first started off I just read threw it and didn't write notes or test out the examples I just read, read, read, and just couldn't keep the information into my head! Then I decided that I would test them out on Garry's Mod, "Woah woah wait a minute Bboy. Whats Garry's Mod?" Well little timmy, it's a were you build stuff and play little gamemodes like "Zombie Survival" and "Roleplay" then you can get all advanced and make actual bots, living robots out of a bunch of props! It's real fun when you get a hand of it! Now lets get back to testing out the lua script on the game. Now when I wrote the lua myself (Well I guess, I didn't just copy it and right click and click copy and then pasted it into notepad.)I replaced for example, "myName = "Jeff"" to "myName = "Bboy"" so it could help me memorize these basic scripts. For me, just coping and pasting the example code to notepad will not help me learn it, I have to give it a little twist in order for me to actually take it in.... Going on.... 


I Didn't know that Lua didn't actually mean anything! In fact, Lua was created a long time ago by a computer graphic technology group in Brazil, And In portugese it means "moon".


Oh and my first Lua script was "Msg("Hello World!")", we have to keep the tradition.

"So what did you learn in day 1 Bboy?" Well I learned about the "myName = "Bboy"" so that everytime you make a message... you know what let me show you another example of what I learned!

"myName = Bboy
Msg ("Welcome aboard "..myName.."!")

Now this little code is just saying "Ok so everytime you say ..myName.. I will replace it with Bboy."

And the last one I learned was

"local age = 15 if age > 20 then Msg("You are over 20! Get out!\n") elseif age < 9 then Msg("You are to young to join DX Land!\n") else Msg("Welcome to DX Land!\n") end"


Now what this is saying is that the age is 15, but if the age is over 20 then displays the message, or if the age is under 9 then displays the message.

But thats about it really Stay tuned for Day 2.

-Bboy


Edit: Sorry I was having trouble with the spacing, something went wrong in the the editor.



1 comment:

  1. I'm 22 so does that mean I have to get out of my own universe?

    ReplyDelete