Alright, so I started trying to teach myself lua the other night with The Garry’s Mod Wiki , and everything was going well, but tonight I attempted to create an addon that when you type in a command, for this example, !SteamID , it will print your steamID in the console.
Anyways, heres the code:
function getSteamID ( ply, text, public, UserID )
if ( string.sub(text, 1, 8) == “!SteamID” ) then
print( ply:SteamID()…" is your SteamID!" )
hook.Add( “print”, “getSteamID”, getSteamID )
Thanks in advance!