Tech Lounge > Programming

*Gmod* Lua - SUPER TUTORIAL!!

(1/3) > >>

Krasher:
Garry's Mod - Lua
A simple hello program.


--- Code: ---print( "Hello BIATCH" )
--- End code ---

FUCK THAT

Btw, I am going to assume you know some basic Lua.

-=Basic GMod Lua Functions=-
-=Gamemode=-
GM:PlayerInitialSpawn( ply ) -- Allows you to edit the players spawn.
GM:PlayerLoadout( ply ) -- The players initial loadout (Ex. Weapons).

-=Player=-
ply:SetHealth( <number> ) -- Easy enough to understand am I right?
ply:SetMaxSpeed( <lowernumber>, <highernumber> ) -- First number is the players normal walk speed, second is the players sprint (shift) speed.
ply:PrintMessage( HUD_PRINTTALK, "Message Here" ) -- Displays a message written in the string.
ply:IsAdmin() -- Is the player admin?
ply:IsPlayer() -- Is the motherfucker a player?
ply:FindHood -- WHERE THE HOOD, WHERE THE HOOD, WHERE THE HOOD AT? (NOT A REAL FUNCTION.)


Section 1: SWEPS!Description: Weapon Scripts.

» Magic «:
KEEP GOING D:!

Krasher:

--- Quote from: «-= Magic =-» on June 05, 2010, 02:51:55 AM ---KEEP GOING D:!

--- End quote ---
I am going to add more today

» Magic «:

--- Quote from: «-= Kräsh∑r =-» on June 05, 2010, 12:10:16 PM ---I am going to add more today

--- End quote ---


Kthx

Tomcat:
ply:isTomcat()


LUA ERRORS OH SHITZ


Error (no function Ply:isTomcat())
SHUTTING GMOD DOWN OF SHEAR AWESOMENESS

Navigation

[0] Message Index

[#] Next page

Go to full version