What's the dumbest mistake you've ever made in lua?
171 replies, posted
[lua]
function InfoMenu()
concommand.add("faggot", Infomenu )
[/lua]
oh god that was a terrible day
I tore my code to pieces for hours trying to fix it before discovering that I was editing my dropbox files and not the ones in my Garry's Mod directory. :v:
Well, for me everything I ever tried to script (Mostly Incomplete/Terrible). Want proof go search my posts, I know I suck. I am learning though. :)
[code]
function(){}
[/code]
[QUOTE=jellybaby34;30629312]Trying to code with absolutely no knowledge of it :eng99:[/QUOTE]
same here lol
[QUOTE=c-unitV2;30655289]Shh, don't tell Science, next thing we know we won't be able to rate him dumb anymore.[/QUOTE]
Thanks for telling me.
Dumbest mistake I've ever made in Lua?
Trying to code a fancy RP gamemode when every SWEP I've ever made has come out with some unfixable error.
I once forgot the distance argument to cam.Start3D2D(), and I could see through everything.
It was awesome.
[QUOTE=Toneo;30729236]I once forgot the distance argument to cam.Start2D3D(), and I could see through everything.
It was awesome.[/QUOTE]
Since when cam.Start3D2D() has a distance argument?
I fucking hate when I forget to put () at the end of a function and sometimes I go blank cause I don't know the problem then i call myself retarded for not noticing it sooner.
[lua]usermessage.Hook("something", function( um )
// stuff
end[/lua]
Forgetting the ")"
[QUOTE=Aide;30729912][lua]usermessage.Hook("something", function( um )
// stuff
end[/lua]
Forgetting the ")"[/QUOTE]
Same for concommands, and timers. :V
[QUOTE=Wizard of Ass;30729339]Since when cam.Start3D2D() has a distance argument?[/QUOTE]
He means the scale argument.
Managed to remove player entity, then tried to spawn the player entity.
I once placed a comma instead of a dot and tried to figure out what was the problem for an hour. :saddowns:
-snip-? :D
I divided by 0 in the HUDPaint hook, my screen went black, and I couldn't figure out the problem for the longest time.
I'm not sure. All I know is my first addon got me the Bad Coder achievement in one go.
[QUOTE=Foxtrot;30747010]I'm not sure. All I know is my first addon got me the Bad Coder achievement in one go.[/QUOTE]
I got bad coder for having dysfunctional wire mod installed.
Misreading the gmod Lua wiki, and copying their example script that (I thought) Bans the player off the server. Adapted it into DarkRP's Wallet and went away for the weekend. When I came back, I was spammed with 'SOMEONE HAXXED THE SERVER'. Turns out that script bans [b]everyone[/b] off the server, so when one person went into minus digits, everyone got banned :v:
[code]
while true do
[/code]
[editline]28th June 2011[/editline]
Well, Giving an admin of my server permissions to execute lua... thats the first thing he did.
[editline]28th June 2011[/editline]
He's not admin anymore.
[QUOTE=Wizard of Ass;30729339]Since when cam.Start3D2D() has a distance argument?[/QUOTE]
Sorry, scale :v:
I hate when I'm speed-coding and I do [lua]function example)([/lua]
[QUOTE=c-unitV2;30776597]I hate when I'm speed-coding and I do [lua]function example)([/lua][/QUOTE]
Yup, thats my most common mistake or just doing
[code]Something function() end[/code]
Basically just messing up simple beginning and ends of functions/hooks/timers/concommands.
I had copied something and for some reason all space characters were replaced with ALT+255 characters.
It took me an hour to figure out what was wrong, and another hour to remove them all.
Ctrl+H?
[lua]
SomeFunction()
--bla bla
end
[/lua]
Forgetting "function" at the beginning of declaring a function. I was staring at it like "Why the hell is this not working?"
[QUOTE=ConTron123;30786940][lua]
SomeFunction()
--bla bla
end
[/lua]
Forgetting "function" at the beginning of declaring a function. I was staring at it like "Why the hell is this not working?"[/QUOTE]
That happened to me for about 3 hours.
Mine just happened now...
[lua]
local pdatax = string.Explode("player_data/"..Player:UniqueID()..".txt")
local pdatax[1] = Name
[/lua]
and I had the pdata[i] for about 11 more times...
[QUOTE=Mr. Quiggles;30815894]Mine just happened now...
[lua]
local pdatax = string.Explode("player_data/"..Player:UniqueID()..".txt")
local pdatax[1] = Name
[/lua]
That about 11 more times.[/QUOTE]
[lua]
local steamid = tostring(pl:SteamID())
if (!steamid ) then return end
local id = string.gsub( steamid,"STEAM","" );
id = string.gsub( id,":","" );
id = string.gsub( id,"_","" );
return id;
[/lua]
use that. not uid
Sorry, you need to Log In to post a reply to this thread.