Determine team a player is on

I can’t seem to find the hook or function I need use in this case… I need to determine what team the player is on. ply:team() is not working client side for some reason. Is there any way to do this easily?

Seems to work for me

] lua_run_cl for k, v in pairs( player.GetAll() ) do v:ChatPrint( “You are on team “…v:Team()…” (”…team.GetName( v:Team() )…")" ) end
You are on team 1001 (Unassigned)

Post your code then chief

function GM:OnSpawnMenuOpen(ply)
if ply:team() == 2 then
LocalPlayer():ConCommand(“slist”)
end
end

Try
[lua]

function GM:OnSpawnMenuOpen()
local team = LocalPlayer():Team()
if team == 2 then
RunConsoleCommand(“slist”)
end
end
[/lua]

You didnt define plteam in yours by the way

His error was capitalization.

It’s “Team()”, not “team()”

Case-sensitivity! :eng101:

Wait he changed his code after i edited it, i couldnt of possibly fixed the case sensitivity

Ya sorry I originally pasted an old version I had tryed… Sorry about that I fixed it as soon as I could

[editline]03:43PM[/editline]

Ok this worked, Thank you very much, both of you!

I fixed capitalization, Dave. Thank you
And I change ply: to LocalPlayer:, Willox. Thank you