GLua - interactive tutorial?


I can only imagine how many times a day you see a noob such as myself, get on these forums, asking the same question - how do I learn lua?

However, after doing some research, I know the very basics of Lua. I believe that I will learn over time, when I begin making scripts. So I was wondering, can anyone give me a VERY simple “task”, that I’d try to complete. For example, you suggest I “make a printer” (No idea how hard that is).
Then I try to actually make it, making use of the wiki and the internet. If I come across problems I REALLY don’t know how to solve, I’ll just ask here, but I’ll try to refrain from asking every single thing I do not understand.

I have no specific reason as to learn GLua/Lua at the moment; I just feel like it would be good to contribute (in the far future) to the game that has given me many fun moments, and just broaden my horizons in general.

Thanks in advance,

I would recommend checking out this thread and try some of these challenges:

Also, try creating some challenges for yourself. Think of simple things you’d like to create, such as a derma menu or a SWEP. Look at already existing addons and scripts to see how they do things and get some inspiration from that, use the wiki to look up things you don’t know.

If you haven’t already I would really suggest giving this a read as well:

That’s kind of the issue. I do not know what is doable and what not, for my level of experience (very low). Thats why id like to take on requests from the FP community, starting with very easy things, and then slowly expanding into bigger projects.

Go on code cadamy and learn Ruby. It’s similar since they’re both OOP languages. You can the go to Code Blues channel on YT. He explains it pretty well. Or just hire someone, like RayChamp.

ruby and lua are not OOP languages at all, you can do oop but they don’t have the features other languages have for it

ruby is and does

Since it sounds like you haven’t actually started doing anything yet a “very simple task” I would suggest is get a basic swep working. From there you have limitless possibilities. I think the first thing I did was make a gun that shot 5 bullets at once. You can try anything. Make a swep that makes you invisible. Make one that temporarily blinds whoever you shoot.
Apart from getting a basic swep working, get a basic entity working (showing in the spawn menu and spawning correctly). Then you can do anything again. Make an entity that when you use it, it spawns ammo entities. Making entities make entities can get to really interesting places. Make a bomb that spawns more bombs. Or a bomb that spawns bananas.

You can really do anything.

The thread Jocken300 linked you is exactly what you need.

Just think of something that you think would be cool in Garry’s Mod. Don’t think about how difficult it might be to make, just try to think of a cool idea that you actually want to do.

It’ll be much more fun than doing some random thing on a thread that you probably won’t get much enjoyment out of, and you’ll learn a lot along the way

Cough 5 Disagrees and 2 dumbs, you pretty much agree with me and get 2 agrees from two people who disagreed with me.

Makes sense…

I don’t think anyone here understands the fact that this guy doesn’t know how to program or any programming fundamentals. So like I said before, go learn Ruby on CodeCadmy. You can’t just jump right into Lua if you don’t know how to program.

After you completed the Ruby course and have a good grip on the fundamentals (tables, if/else/ifelse, functions, etc), then you can ease yourself into Lua.

Or as I otherwise stated, hire someone to teach you. So you can have 1 on 1 and the teacher will be able to point out all your mistakes.

Any programming language can be someone’s first programming language, there’s NO reason to have to learn Ruby before learning Lua.

The absolutely best way to learn to program is to make stuff you actually like. Making gmod addons if you like gmod is the perfect motivation for learning and progressing. Ruby on the other hand would be a boring joyless effort to learn a programming language that maybe, if he’s lucky, he might be able to use once or twice in the future. Lua is a language he wants to be using now.

I rated you dumb because the “advice” you gave is completely counter-beneficial for the one asking, and doesn’t answer his question at all. I imagine that everyone else who rated you feels the same.

We’re not out to get you, you’re just wrong in this particular case.

Eyyyyy, wanna know why he should learn Ruby before Lua?

Because cough he asked for an interactive tutorial. Which cough CodeCadamy provides.

Also, Lua isn’t for people who have 0 programming experience. This guy, I assume, has none. He would be better off learning Ruby first because it will give him the knowledge of fundamentals in programming while also at the same time having an online, interactive interpreter.

He could always use Gmod but besides reading from a book, he wouldn’t really learn why the syntax is like that, he would just learn “It just has to be like that. I dunno why, it just is”. In Ruby he can. It makes learning Lua, and other languages that are OOP, a lot easier.

To simplify this, I don’t believe he wants to learn Lua specifically, what I think he wants to do is learn how to PROGRAM in Lua. Meaning he must first learn how programming works before he starts learning how to do it in Lua. Ruby in CodeCadamy teaches you that. In my opinion, a lot better than an online text guide.

To prove my point, he is still asking the same question from a year ago.

Actually me when I made my first crafting system (was modifying a crappy one) :v:

[editline]11th December 2016[/editline]

I did learn Lua from scratch, many difficulties but so far so good

[editline]11th December 2016[/editline]

Plus in my point, Lua is easier for beginner instead of C, which is many people’s first language

What did you quote me on? I don’t remember posting that.

Also Lua from scratch as in nothing or scratch as in the drag n’ drop code like a pro?

Ruby was my first language. Helped me learn a lot about the basics of programming and understand other languages a lot better.

I changed the quote so it look funnier than snip

And it’s from nothing, I just read people’s code, look into WAYWO and take that as my motivation

i literally had no experience when I started lua, now, i aint amazing but i know enough to handle some shit :wink:

if anything, i feel like glua is a good language to start with, because it’s fun working with it on a platform such as Garry’s Mod.

just don’t stick to glua for the rest of your life, try stretching out and learning other shit :smiley:

Yo script look awesome though I haven’t had paypal to buy shit :frowning:

Maybe, but I am giving him advice on how I did it. I think he would be better off if he did it the way I did.
It’s obvious that reading from online guides isn’t working for him. So maybe instead of doing it the way everyone has been telling him to do it (which is go read the guides and test it in gmod), he could try it my way.

Also you should watch out or you might be banned for care about rating

[editline]11th December 2016[/editline]

Oh you just broke my merge :frowning:
Well your suggest isn’t look bad either
Gonna take a look at Ruby

I don’t care about ratings, I was pointing out hypocrisy.