So I have been working with an npc framework I bought to make an npc that changes your job but heres the problem with that after using the function ply:changeTeam(TEAM_PRES,true) i soon realized that I need a function that stops people from joining teams more than once....I have a president class in my server and after having a friend test my npc You can become president more than once which your not supposed to be able to do..... I need a function or something that checks if there already is a person in an existing job or checks if the maximum amount of people are already in that job and changes them back to citizen or something to prevent people from spamming a job bc otherwise I am going to hire admins to regulate this kinda traffic which i really don't want to do...I am in a discord under code blue and some guy told me about loops and I get the concept but have no idea how to use them or use them for what i need here -- This sets the model for the NPC. NPC.model = "models/player/group01/male_05.mdl" -- This is for player models that support player colors. The values range from 0-1. NPC.color = Vector(1, 0, 0) -- Uncomment to make the NPC sit. --NPC.sequence = "sit" -- This receives the ignite message from cl_init.lua -- client is the player that sent the message. -- As you can see, the seconds argument is available. function NPCnIgnite(ply,client, seconds) --client:Ignite(tonumber(seconds) or 5) ply:changeTeam(TEAM_PRES,true) plyrintTable( team.GetPlayers( ply:Team() ) ) -- for k, v in pairs(player.GetAll() ) do -- print(k .. " " .. v:GetName()) --prints the key and the value(the player)'s name ---using this makes the fucking npc not even work god damn it end --end -- Called when the entity for the NPC has been created. -- This allows you to modify the NPC itself. function NPCnEntityCreated(entity) --print(entity) --entity:Ignite(5) end --- Double Post Merged, Aug 8, 2017 --- why are there emojis in my text ugggggg --- Double Post Merged, Aug 8, 2017 --- also what does something like this do this isnt my code but i found this on another forum for k,v in pairs(RPExtrateams) do if k = TEAM_POLICE then local policemodel = v.model; end end what does RPExtrateams do? --- Double Post Merged, Aug 8, 2017 --- ALSO!!!!! what would be a function or something to create a vote for changeTeam(TEAM_PRES,true)?