Lua help

Hello facepunch I want to learn lua I’ve read through the lua tutorial series already but I still don’t get what a table does like I know it organizes but I don’t get the point of how it organizes I also want to make a simple YouTube player for garrysmod is their a tutorial for that?

Thank you for helping I’ll just keep posting my questions here on this thread I guess.

I’m not a lot experienced in LUA but I suggest you to learn basic stuff first before making -that- stuff (YouTube players etc)… Cause, well, you cannot get a tutorial for whatever you want to do…

Can someone give me links to good tuts and stuff on gmod lua please?

Thanks

Make sure you have read everything in here:

But let me explain what a table is.

This is a table:

[lua]
TableExample = {}
[/lua]

^^ This table is empty.

[lua]
TableExample = {
2,
5,
7
}
[/lua]

^^ This table has integers inside it.

[lua]
TableExample = {
2,
“hello”,
pwnage
}
[/lua]

^^ This table has an integer, a string, and a variable.

Once a table has been defined, you can use it for various purposes.

Say you have a basket of apples. The ‘table’ is the basket and the ‘apples’ are the things within.

Everything here

And the function search is useful
http://luasearch.overvprojects.nl/index.php

Youtube has some, but I don’t recommend youtube.

When you finished everything the wiki has to offer, just experiment new things, and if you have questions facepunch is here. :smiley:

I already read through that lua tut series what is something easy I can do for my first project and thanks for explaining the table it makes sense now

Start with making basic entities/weapons.

Yeah but what kind of entity? I want to make a wepon but seems hard I want to start out with an entity first give me an idea? I’m clueless right now on what to make

That was my first one, and I just changed things around to make it cooler and more unique.

The first part of coding is being able to take apart others’ pieces of code and understand it.

The second is making additions and modifications to that code.

The third is creating your own code.

Cool I will make my swep throw watermelons :open_mouth: and soda cans

Are there anymore places that provide in depth gmod lua tuts???

Ok I made teh gun primary is to fire watermlons secondary fire fires babies :smiley:

But are there more places I can learn lua BESIDES the wiki that teach morE stuff?
I understand the basic stuff but i want to Learn more in depth stuff like making a motd for the evolve admin mod

or something else that’s easy like what was the first thing you made with lua?

Well, take a look inside the source of the Evolve Admin Mod, see how it’s made and try to understand it. Then later look at a plugin(or w/e it’s called) and make one of your own.

I also use this page a lot to stumble upon things I didn’t even know existed: http://wiki.garrysmod.com/?title=Special:Random

I was looking through the forums at codes trying to understand them I stumbled across things that still don’t make sense such as hook and the for k,v inpairs what do those mean?

There are explanations for both ‘hooks’ and ‘for loops’ on the garry’s mod wiki. Read the tutorials for beginners. Going through the LUA documentation might help too.

How do I create a job for darkrp like how would I make a bounty hunter job? Where people place bounties for a certain amount of money on a person and the weapon the bounty hunter starts out with is let’s say a mp5 and the bounty hunter can see who to kill with a menu and when they kill that person they get the money automatically once they kill them and only the bounty hunter that killed the person