Right so I can’t really find out what’s wrong with what I’ve written. This is only my 2nd day messing around with Lua and trying to get the hang of it, and I can’t really find out why this won’t work. I’ve tried looking through various garrysmod.org items that I figured would have the solution but I can’t find anything and google isn’t being helpful.
[lua] SixShooter.DoClick = function(ply)
if ply:Alive() then
ply:ChatPrint(‘You must be dead to change your weapon!’)
It keeps telling me that:
attempt to call method ‘Alive’ (a nil value)
[sp] Line 2[/sp]
I don’t really see how I can work my way around this since I pretty much do need the player to not be alive if they want to activate the button. If anybody can tell me what I’m doing wrong and perhaps why it’d be extremely helpful. Also excuse me if the lua is very poorly written, I don’t have much control over that at the moment.