Welcome, Guest. Please login or register.

Author Topic: Learn To Script Lua  (Read 10915 times)

0 Members and 1 Guest are viewing this topic.

Offline Ducky

Learn To Script Lua
« on: November 27, 2010, 07:59:27 AM »

Follow these steps then maggot!

Download the program Notepad++. This program is great for scripting in the Garry's Mod Lua syntax because it has a highlighting plugin made for it that makes scripting much easier. Once you get the Garry's Mod plugin, install all the files in the zip you downloaded into the programfiles/notepad++/plugin directory. Start up Notepad++ and click on the language tab at the top and you should see the language "Gmod Lua" selectable, select that and you are ready to start learning!

This website is your god for the rest of your scripting career.

Garry's Mod Lua Wiki

This website has every function, hook, and command that you can give in Garry's Mod with Lua, and then some. If you ever see something you don't understand, just go to that wiki page and search for it. This is how you will learn how things work generally, and how you will memorize functions and hooks to speed up your scripting.

Starter Lua Tutorials

Read those and make sure you fully understand them. After that, you are on your way to understanding Lua.



PLEASE, I am BEGGING you. Post all the questions you have about Lua coding in this thread. I will gladly answer anything you are confused on. It's what I am here for.  frogc00l


Make a simple deathmatch gamemode with a simple custom hud, without Fretta.
Make a melon that follows you around.
Make a script that allows you to charge up your jump, with a simple hud bar to gauge the power.
Take a crack at making your own custom scoreboard.
Make zombie NPCs spawn at random locations on a map, and not get stuck in walls.

« Last Edit: November 27, 2010, 02:51:54 PM by Molested Rubber Ducky »

Offline Ducky

Re: Learn To Script Lua
« Reply #1 on: November 27, 2010, 02:52:06 PM »
Thread is finished!  trollface

Conjoint Gaming [Game On]

Re: Learn To Script Lua
« Reply #1 on: November 27, 2010, 02:52:06 PM »

Offline Travis

Re: Learn To Script Lua
« Reply #2 on: November 27, 2010, 03:16:15 PM »
Make zombie NPCs spawn at random locations on a map, and not get stuck in walls.


Lulz.
Boobs.

Offline Wholegrain

Re: Learn To Script Lua
« Reply #3 on: November 27, 2010, 03:17:56 PM »
im going to attempt to learn basic lua coding and then try to advance my skills to the point i can actually help keep the ttt server run more fluently and rely more on myself then on others

Offline Ducky

Re: Learn To Script Lua
« Reply #4 on: November 27, 2010, 03:20:15 PM »
Make zombie NPCs spawn at random locations on a map, and not get stuck in walls.


Lulz.

I was hoping someone would catch on to that.

Offline Ducky

Re: Learn To Script Lua
« Reply #5 on: November 27, 2010, 03:20:58 PM »
im going to attempt to learn basic lua coding and then try to advance my skills to the point i can actually help keep the ttt server run more fluently and rely more on myself then on others

Thats awesome, I highly suggest it.

Offline AlphaWeeaboo

  • How does one maintain community when no power?
  • Commando
  • ********
  • Banned!
  • Posts: 3929
  • 446 Credits
  • View Inventory
  • Send Credits/Gift
  • How does one maintain community when no power?
    • View Profile
Re: Learn To Script Lua
« Reply #6 on: November 27, 2010, 03:22:53 PM »
Make zombie NPCs spawn at random locations on a map, and not get stuck in walls.


Lulz.

I was hoping someone would catch on to that.
I was going to say the same thing!
But anyways I'll have to try this out. I've always been interested in learning some coding.

Offline Travis

Re: Learn To Script Lua
« Reply #7 on: November 27, 2010, 03:30:59 PM »
Make zombie NPCs spawn at random locations on a map, and not get stuck in walls.


Lulz.

I was hoping someone would catch on to that.
I was going to say the same thing!
But anyways I'll have to try this out. I've always been interested in learning some coding.
These are pretty good websites and if you need help just ask Ducky about it.
Boobs.

Offline Ducky

Re: Learn To Script Lua
« Reply #8 on: November 27, 2010, 03:36:47 PM »
Make zombie NPCs spawn at random locations on a map, and not get stuck in walls.


Lulz.

I was hoping someone would catch on to that.
I was going to say the same thing!
But anyways I'll have to try this out. I've always been interested in learning some coding.
These are pretty good websites and if you need help just ask Ducky about it.

Please do, I am here to help.

Offline Travis

Re: Learn To Script Lua
« Reply #9 on: November 27, 2010, 04:29:51 PM »
When I do

loop=10
for i=1,loop do
    Msg("This person was number "..i.." out of "..Loop.."  people.")
end

I get:

attempt to concatenate global 'Loop' (a nil value)

Edit: I see what I did wrong
« Last Edit: November 27, 2010, 04:33:08 PM by Travis »
Boobs.

Offline AlphaWeeaboo

  • How does one maintain community when no power?
  • Commando
  • ********
  • Banned!
  • Posts: 3929
  • 446 Credits
  • View Inventory
  • Send Credits/Gift
  • How does one maintain community when no power?
    • View Profile
Re: Learn To Script Lua
« Reply #10 on: November 27, 2010, 04:36:02 PM »
Make zombie NPCs spawn at random locations on a map, and not get stuck in walls.


Lulz.

I was hoping someone would catch on to that.
I was going to say the same thing!
But anyways I'll have to try this out. I've always been interested in learning some coding.
These are pretty good websites and if you need help just ask Ducky about it.

Please do, I am here to help.
That's what my doctors tell me. XD
But anyways how easy is the language and learning it? Is it something that can be picked up right away or takes some time before you can produce something noticeable?

Offline Ducky

Re: Learn To Script Lua
« Reply #11 on: November 27, 2010, 04:37:14 PM »
When I do

loop=10
for i=1,loop do
    Msg("This person was number "..i.." out of "..Loop.."  people.")
end

I get:

attempt to concatenate global 'Loop' (a nil value)

Edit: I see what I did wrong

Just so you know, this is always a bitch for anyone to figure out. This is the code you always use to make v mean all players.
Code: [Select]
for k,v in pairs(player.GetAll()) do
That is just something that stumps a lot of people and that can only be realized as an example.

Offline Ducky

Re: Learn To Script Lua
« Reply #12 on: November 27, 2010, 04:38:59 PM »
Make zombie NPCs spawn at random locations on a map, and not get stuck in walls.


Lulz.

I was hoping someone would catch on to that.
I was going to say the same thing!
But anyways I'll have to try this out. I've always been interested in learning some coding.
These are pretty good websites and if you need help just ask Ducky about it.

Please do, I am here to help.
That's what my doctors tell me. XD
But anyways how easy is the language and learning it? Is it something that can be picked up right away or takes some time before you can produce something noticeable?

It is relatively easy and takes just a little bit of time to fully understand. You can be producing something noticeable in Garry's Mod within the first hour of knowing the language. Garry's Mod makes Lua extremely easy, don't get me started on Lua for shit like WoW and other games.

Offline Travis

Re: Learn To Script Lua
« Reply #13 on: November 27, 2010, 11:18:15 PM »
Make zombie NPCs spawn at random locations on a map, and not get stuck in walls.


Lulz.

I was hoping someone would catch on to that.
I was going to say the same thing!
But anyways I'll have to try this out. I've always been interested in learning some coding.
These are pretty good websites and if you need help just ask Ducky about it.

Please do, I am here to help.
That's what my doctors tell me. XD
But anyways how easy is the language and learning it? Is it something that can be picked up right away or takes some time before you can produce something noticeable?

It is relatively easy and takes just a little bit of time to fully understand. You can be producing something noticeable in Garry's Mod within the first hour of knowing the language. Garry's Mod makes Lua extremely easy, don't get me started on Lua for shit like WoW and other games.
How long until you can create a game mode?
Boobs.

Offline Ducky

Re: Learn To Script Lua
« Reply #14 on: November 28, 2010, 12:01:00 AM »
Make zombie NPCs spawn at random locations on a map, and not get stuck in walls.


Lulz.

I was hoping someone would catch on to that.
I was going to say the same thing!
But anyways I'll have to try this out. I've always been interested in learning some coding.
These are pretty good websites and if you need help just ask Ducky about it.

Please do, I am here to help.
That's what my doctors tell me. XD
But anyways how easy is the language and learning it? Is it something that can be picked up right away or takes some time before you can produce something noticeable?

It is relatively easy and takes just a little bit of time to fully understand. You can be producing something noticeable in Garry's Mod within the first hour of knowing the language. Garry's Mod makes Lua extremely easy, don't get me started on Lua for shit like WoW and other games.
How long until you can create a game mode?

Probably a couple days. You need to understand how everything works before you apply it to something large such as a gamemode.

Conjoint Gaming [Game On]

Re: Learn To Script Lua
« Reply #14 on: November 28, 2010, 12:01:00 AM »

 


* ShoutBox!

Refresh History

SimplePortal 2.3.5 © 2008-2012, SimplePortal