How do I make it so it sets you model based on your team?

I am working on a team deathmatch gamemode, but I can’t seem to find a way to set the team. Can anyone help me?

Way one: good old if statement.


if pl:Team() == 1 then pl:SetModel("model")
elseif pl:Team() == 2 then pl:Setmodel("model2")
end

Way two: cleaner tables.



local models = {
[55] = "model1",
[73] = "model2",
}

pl:SetModel(models[pl:Team()])

Thanks man!