This is a basic template with the purpose of including all arguments / table variables to make it easily known which values can be accessed.
gameevent.Listen( "player_spawn" )
hook.Add( "player_spawn", "player_spawn_example", function( data )
local id = data.userid // Same as Player:UserID()// Called when the player spawns initially or respawns.end )