Hello. I’m quite new to lua and I started making a gamemode based on the default sandbox gamemode. What I’m trying to make is a message saying “(player name) spawned in the server. Rank: (team name)”. This is what I have so far:
function GM:PlayerInitialSpawn(ply) PlayerDataUpdate(ply) PrintMessage(HUD_PRINTTALK, ply:Name() .. " spawned in the server. Rank: " .. team.GetName(ply:Team())) end
However, when someone first spawnes in the server it always says “Rank: Joining / Connecting”. I have all my groups set up and teams assigned to them but I just can’t get the team name to display in that message. Are the teams assigned after this function? If yes, then what should I do?