Init()
{
    level thread OnPlayerConnect();
}

OnPlayerConnect()
{
    for(;;)
    {
        level waittill("connected", player);

        Print(player.name + " GUID: " + player.guid);

        player thread OnPlayerSpawned();
    }
}

OnPlayerSpawned()
{
	self endon("disconnect");

    for(;;)
    {
		self waittill("spawned_player");
        
		Print(self.name + " GUID: " + self.guid);
	}
}