Difference between revisions of "Lua:player killed"
From Fortress Forever Wiki
Jump to navigationJump to searchm (Lua:Player killed moved to Lua:player killed) |
|||
Line 1: | Line 1: | ||
+ | {{Infobox manual/Header}} | ||
This function is called whenever a player dies. The global variable "killer" will be set, which contains the player that killed this player. | This function is called whenever a player dies. The global variable "killer" will be set, which contains the player that killed this player. | ||
Line 14: | Line 15: | ||
[[Category:Lua Commands]] | [[Category:Lua Commands]] | ||
+ | {{Infobox manual/Footer}} |
Revision as of 17:36, 31 December 2007
Here's an example if you wanted to give your team a point when you killed someone not on your team: function player_killed( player_id ) -- If you kill someone, give your team a point if GetPlayerTeam( killer ) then if not ( GetPlayerTeam( player_id ) == GetPlayerTeam( killer ) ) then AddTeamScore( GetPlayerTeam( killer ), 1 ) end end end |