|Line 16:||Line 16:|
|desc=If true, the player just spawned from a map transition.
If true, the player just spawned from a map transition.
Revision as of 16:15, 4 September 2019
Called when the player spawns for the first time.
This hook is called before the player has fully loaded, when the player is still in seeing the "Starting Lua" screen. For example, trying to use the Entity:GetModel function will return the default model ("player/default.mdl")
Prints the name of the player joining.
function GM:PlayerInitialSpawn(ply) print( ply:GetName().." joined the server.\n" ) end -- That way you are overriding the default hook -- you can use hook.Add to make more functions get called when this event occurs local function spawn(ply) print( ply:GetName().." joined the game.\n") end hook.Add( "PlayerInitialSpawn", "some_unique_name", spawn )