I can't explain this, because it's unexplained. I don't understand what you're doing.
I try
playerst[uPlayer] = setTimer( setPlayerTeam, 100, 1,
uPlayer,
getTeamFromName( team[ math.random( #teams ) ] )
)
Cut
getTeamFromName( team[ math.random( #teams ) ] )
team is userdata NOT TABLE!!
Also
getTeamFromName
Have only one argument and only STRING.
local teamP = teams[source]
source = resource, so index is nil
setElementModel ( uPlayer, teamP.skin )
Same, teamP is nil
for weapon, ammo in pairs (teamP.weapons) do
Same ^^
Please learn lua!
viewtopic.php?f=148&t=40809