Welcome, Guest. Please login or register.

Author Topic: Learn To Script Lua  (Read 12791 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
  • Careful what you post. Forum rules still apply in the shoutbox!
  • Pyro: happy birthday Tyber
    July 14, 2024, 01:55:16 PM
  • Finniespin: More of a Patrick Hernandez guy - Born to be Alive
    June 16, 2024, 09:14:27 AM
  • Sly: Aaron Hernandez was a legend of a man
    June 14, 2024, 01:46:02 AM
  • Finniespin: how? what?
    June 01, 2024, 06:28:43 PM
  • Inject OH 4: Lost my discord rip
    May 30, 2024, 12:14:57 AM
  • Finniespin: yoooooooo!
    April 03, 2024, 05:32:48 PM
  • Coreybush11: bump
    April 01, 2024, 10:59:48 PM
  • Finniespin: wut
    March 28, 2024, 05:01:26 PM
  • Inject OH 4: And yes thank you very much Finnie! You are a champion xP
    March 22, 2024, 05:59:12 PM
  • Inject OH 4: Hey abrys agreed we should.
    March 22, 2024, 05:59:02 PM
  • Finniespin: Totally not a spam-bot, also totally not a limited time offer
    March 03, 2024, 05:25:06 PM
  • Finniespin: Anyone looking for a datacenter technician job? We got postings available around US and Europe (EMEA)
    February 17, 2024, 07:23:12 AM
  • Finniespin: https://www.google.com/about/careers/applications/jobs/results/118336179041903302-data-center-technician-global-server-operations
    February 17, 2024, 07:20:25 AM
  • Finniespin: Gave Inject 50 euros to pay for fees ^^
    February 17, 2024, 07:17:42 AM
  • xXArbysOvenMittXx: we gotta get the crew together again one day and hang, add me on discord: ogarbies
    February 12, 2024, 06:52:07 PM
  • xXArbysOvenMittXx: yo who is still paying for this lol
    February 12, 2024, 06:19:47 PM
  • Klondor: wow CG still lives, mind blown
    February 09, 2024, 05:13:53 AM
  • Finniespin: The website is back online!!!
    February 06, 2024, 03:17:05 PM
  • Inject OH 4: xD
    January 14, 2024, 05:55:44 PM
  • Finniespin: Get a load of this guy
    December 16, 2023, 09:16:03 AM
  • Inject OH 4: Sure
    December 09, 2023, 07:22:27 PM
  • HailToTheKing: cum shot . and cum shot. an d cum shot
    December 01, 2023, 01:54:12 PM
  • Finniespin: ffuck
    November 24, 2023, 03:43:47 PM
  • Inject OH 4: ee
    October 12, 2023, 01:13:56 AM
  • Sly: dd
    August 09, 2023, 03:13:48 AM
  • Inject OH 4: cc
    August 03, 2023, 09:51:36 PM
  • Finniespin: bb
    August 02, 2023, 06:12:50 PM
  • Inject OH 4: aa
    July 04, 2023, 10:29:35 PM
  • Shikaru: Been a very long time
    February 20, 2023, 05:42:04 PM
  • Shikaru: Oh wow my account is STILL active :)
    February 20, 2023, 05:42:00 PM
  • Napoleon BonaPARTY: yooo we got a lovense sponsor???
    December 16, 2022, 03:45:43 PM
  • Napoleon BonaPARTY: holy shit
    December 16, 2022, 03:45:24 PM
  • Napoleon BonaPARTY: oh wow its still here
    December 16, 2022, 03:45:21 PM
  • HailToTheKing: legends never die
    October 16, 2022, 01:28:09 PM
  • Live Bait: Oh wow. Still remember my old password.
    September 23, 2022, 08:37:38 AM
  • Mr_Rainbow: Still alive. Hope all is well with everyone this Christmas
    December 09, 2021, 03:31:04 AM
  • SlyWilliam: Much love, from our MC server to our ZPS server <3
    December 07, 2021, 10:23:37 PM
  • SlyWilliam: For the record, I don't REALLY remember all of you, but goddamn do I MISS all of you <3
    December 07, 2021, 10:23:10 PM
  • Pyro: parrot
    September 07, 2021, 05:23:18 AM
  • Inject OH 4: Do you mean for people that haven't come on in a long time and have to reagree?
    August 02, 2021, 11:39:42 PM

SimplePortal 2.3.5 © 2008-2012, SimplePortal