Gamemode.PlayerSpawn

From GMod Wiki

Jump to: navigation, search
Event Hook
Hook NamePlayerSpawn
SyntaxGM:PlayerSpawn( Player Player )
DescriptionCalled whenever a player respawns.
ReturnsNil
Lua StateNewerServer.png
BBCode[b][url=wiki.garrysmod.com/?title=Gamemode.PlayerSpawn]Gamemode.PlayerSpawn [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionPrints a message when the player spawns
Used onNewerServer.png
Code
function GM:PlayerSpawn( ply )
 
	print( "The player \"" .. ply:GetName() .. "\" has respawned." )
 
end
OutputThe player "<PlayerName>" has respawned.


See Also

Hook.Add


Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox