Any Lua Coder That is able to answer this question?


I am DizzyGhost and for years I have been trieng to get into programming.
After tons of tutorials I always stop, but now I want to go 100% for it.
Now I am learning how to make gamemodes, but I realized…
I am just typing what the person is saying to type without even knowing what it does.
How would I ever learn to programm in lua?

What do I do?!!

Read the PIL or gmod wiki.

I learned without the PIL… in fact, I learned from (hate me if you like)… anyhow, I’ve managed to produce codes by my own understanding such as a code which makes a combine ball fly straight through you, or a relationship, in fact, I’m going on to full SNPCs now… I only started official coding at sometime late last year…
So, browse around a few LUA sections in the Garry’s mod wiki (any of the 2 or both…) and it might serve you well.

I doubt you can learn programming in lua, but you can try thought. That would be something innovative
Also I’ve made a doc. file for my friend with basics of lua, filled with examples and tips, I would share it with you, but I dunno, just maybe.

download a few scripts (ex weapons or gamemodes), search through them, whenever you see a line thet you can’t figure out what it does, look it up on google. Also start small, like converting small things from gmod 12 to 13.

I am still trying to learn LUA don’t worry, I have been at the position you are at just try to find something you want to create and try to figure out what you need to do to make it happen LUA is one of the most dynamic languages out there and you can just do about anything with it!

Look at scripts other people have made and try modifying them slightly. Then once you’ve gotten that down fully, move into copy pasting code to create unique scripts ( If it’s a large amount of code copied, give credit where due ), and from there move onto fully writing your own stuff. That’s how I did it anyways.

No offense to anyone in this thread, but if you just dive in and start trying to make things you’re going to make terrible code.
The PiL book is a fantastic resource. I wish I’d read it when I started to Lua, I might not have made so many shitty scripts.
If you have some trouble understanding the concepts in the book, you might want to pick up some general programming knowledge at Code Academy. It’s a great website and 99% of the things it’ll teach you can be used in Lua.

Could someone with knowledge of any languages use the PIL and understand it?

That’s generally the idea. It’s not that great for complete novices since it expects a rudimentary knowledge of general programming concepts (hence my code academy suggestion) but it’s a complete primer to all things Lua.

yes, i started only knowing javascript and batch coding and understood it.

How about someone with no knowledge whatsoever? Maybe the first language they wanted to learn was Lua, could they understand it then? (Just trying to help people looking for these types of answers)

Lua is not a good first language, if only because there aren’t many decent tutorials. I recommend JavaScript.

I wouldn’t necessarily say that.
My first coding language was lua and I learned all the basics from the wiki. Then when I had a lot of troubles with concepts like plugging in values to the indexes of tables I had to go ask somebody else for help that knew how to explain it well enough for me to understand it. Everybody just needs a push now and then.

There’s a lot of help for people learning JS on the web that simply doesn’t exist for Lua.
Sure, you can muddle yourself along and get by if you have to but I think you’d have a far better time of it if you learned the basics on a more widely supported language before coming back home.

One final question, what would you recommend for someone stubborn and they are going with Lua as their first language? What tips would you give them? What books/tutorials/guides would you show them?
(I know a few people like this)

read the PiL book (as stated above), also the wiki. I don’t recommend not learning another language, though. It will make it a lot harder to learn, where as if you learn another language first, you have a better understanding of what you’re doing.

Don’t use DarkRP as a reference it’s coded like shit.

Thanks guys, I’ll show this to anyone I know who is going to learn Lua first

Relevant - consider what it means to be a programmer and decide if you really want to put this level of dedication into learning it.

Generally, this thread is going to cover the same topics.

What it boils down to is that PIL is written for people who have a programming background and telling people without this background to just read PIL and all shall be revealed isn’t good practice. Figure out if you want to seriously program, and start with another language that will give you a better understanding of the logic and then apply what you’ve learned to other projects and languages.