Player.Alive

From GMod Wiki

Jump to: navigation, search
Function
Syntax Player:Alive( )
Description:
Returns true if the player is alive.
Returns: Boolean
In Object: Player
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Player.Alive]Player.Alive [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionSimple code to check whether the player is Alive.
Used onNewerShared.png
Code
 
function checkAlive(ply)
	if ply:Alive() then //Returns Boolean
		ply:ChatPrint('You are \"Still Alive\"') //If true (You are Alive)
	else 
		//If not (You are Dead)
		ply:ChatPrint("The Cake was a lie? Now do you believe me?")
	end //End If statement
end //End Function
 
OutputYou are "Still Alive"
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox