Player/Kill

From Garry's Mod
Jump to: navigation, search
 Player:Kill( )

Description

Kills a player and calls GM:PlayerDeath.

Examples

Example

When the user types "/respawn" the user will be killed and then respawned.

hook.Add( "PlayerSay", "RespawnCommand", function( ply, text, public )
	if ( string.lower( text ) == "/respawn" ) then
		ply:Kill()
		ply:Spawn()
		return ""
	end
end )


Personal tools
Navigation