Post Your: First Lua Project

Everyone has to start somewhere, some people (including me) start with hacks, other people start with derma while others start with simple gamemodes…
Regardless of how you started, this it a thread where you can post your ridiculously crappy first attempts at lua scripting for our enjoyment.

I’ll go first, my first hack ever made, man… I was so happy I learned how :ToScreen() works.

This was the first thing ever I released for GMod.

Funny part is, I didn’t even create it, I edited this:

Let’s see if anyone can beat crappiness of my first ever release. :v:

You said Lua not Glua.

This, I suppose.

My first attempt at Lua ended with the code:

function GM:PlayerNoClip(ply)
return ply:IsAdmin()

I didn’t touch Lua again until a few months later, so I suppose this counts.

My first project was adding energy to gemstone printers.

(not so) sadly, I don’t think there are any pictures left over

Omg people’s first project…
This should be good.
Anyways, I belive I made this crappy piece of shit before anything else

hook.Add( "PlayerSay", "Help", function( ply, text, team )
	if ( string.sub( text, 1, 5 ) == "/help" ) then--if ( the first 5 letters are /help continue
	Panel:OpenURL( )
end )

Oh god…Almost 3 years and 1 month ago…

My first project (That lead to at least 5 server-crashes) was a steamgroup scanner that should promote people in my steamgroup and demote if they leave.
I didn’t knew back then how to store the steam64IDs in a table … so I had a 1800+string in a text-file and used string.find to detect people.
Massive lagspikes.

Most of the stuff here.

If TTT weapons count, then that. If not, I made some shitty TTT scripts that didn’t work and posted the code here on my brother’s account like a year back. I’ll try to find it.

EDIT: Found the scripts, they look absolutely lovely:
function notifyDisconnect( ply )
PrintMessage( HUD_PRINTTALK, ply:GetName() … " ( SteamID: " …ply:SteamID() … " ) has left the game. /n "

hook.Add( “PlayerDisconnected”, “notifyDisconnect”, notifyDisconnect );


function informDead( victim, weapon, killer )
if victim:GetRole == killer:GetRole or victim:GetRole == roles[1] and killer:GetRole == roles[1] or victim:GetRole == roles[1] and killer:GetRole == roles[3] or victim:GetRole == roles[3] and killer:GetRole == roles[1] then
local deathState = “teamkilled”
else local deathState = “killed” end

victim:PrintMessage( HUD_PRINTTALK, "You were " ..deathState.. " by" ..killer.. " [ " ..killer:GetRole().. " ] using " ..weapon.. ". /n"
killer:PrintMessage( HUD_PRINTTALK, "You " ..deathState.. " " ..victim.. " [ " ..victim:GetRole().. " ]"

if deathState == "teamkilled" then
	victim:PrintMessage( HUD_PRINTTALK, "Were you RDMed? If so, type !report in chat to report the RDMer /n"
else end


hook.Add( “PlayerDeath”, “getKiller”, informDead );


function reportRDM( ply, text, public )
if (string.sub(text, 1, 7) == "!report ") then
return "@ "…string.sub( text, 8 );

hook.Add( “PlayerSay”, “reportRDM”, reportRDM );

my first lua project ever
print"(hello world)"

So I found out that admins on darkrp were pretty dumb and couldn’t trace you down if you did /rpname something random after you rdmed/propkilled.
After a while I got annoyed by having to come up with new names in seconds and then manually typing them out, so I started looking into lua and made a script for it

You can see it evolve from being preset names (still love what I came up with) to generating them from a list of first and last names.
The most recent verison in the new repo generates them from parts of names that other players on the server have. (Has the “nice” side effect of getting legit players banned :v)

I know of admins who are still thay dumb :v: anyways I just edited a bunch of addons to do what I wanted lol

this was one of my first “projects”

function sex( ply, text )
	if( string.sub( text, 1, 4 ) == "!sex" ) then
		ply:PrintMessage( HUD_PRINTCENTER, "You got aids, and died :( " )
		return ""
hook.Add( "PlayerSay", "getaidsyo", sex)

:v: :v:

Oh, god… I found something even older…

This was the first thing I ever made:

I was so proud of this HUD when I made it by copy pasting functions from a free HUD… Even though it only worked at 1080p…

first lua project was on a harddrive that I don’t have anymore, but it was a shitty team 1 v team 2 type gamemode, before I could do any amount of derma, SWEP/ENT creation, or anything considered “intermediate”. Needless to say it sucked ass.

I should redo it.