A few days ago I thought of some good gamemode ideas, so I thought I would learn how to script Lua. Right now I am making some small gamemodes to sort of get used to how Lua works. I'm trying to make a One In the Chamber type of gamemode. As you may know, when you get a kill with the pistol in OITC you are supposed to get another bullet. I can't figure out what the function is when a player gets a kill. I would assume it would be something like: GM:PlayerFrag(), but I can't find anything. I've searched Google as well as an advanced search of this forum. If anyone could help or point me in the right direction, it would be awesome. Thank you in advanced.
This is the hook you're looking for. [url]http://wiki.garrysmod.com/page/GM/PlayerDeath[/url]
Make sure the attacker is valid, is a player and is not the victim (if the attacker == victim then it was suicide). If he is, give him a bullet.
Thank you so much. I had no idea I could use that function for more than just the ply. I never thought of giving the bullet to the attacker.
No problem, remember to mark your thread as solved!
Sorry, you need to Log In to post a reply to this thread.