redditing Posted June 17, 2020 Share Posted June 17, 2020 Okay, so I would like to give M4 to each person from the "Red" team, and to every player from the "Blue" team I would like to give Ak47, How can I do it? -- server side red = createTeam("Red team", 255, 0, 0) blue = createTeam("Blue team", 0, 255, 0) giveWeapon("red team????", 31, 9999) giveWeapon("blue team????", 30, 9999) Something like this is on my mind but I do not know what to put in the "string" red team and blue team... Link to comment
redditing Posted June 17, 2020 Author Share Posted June 17, 2020 8 hours ago, -Ilker. said: use getPlayersInTeam And with loop i can do it? Link to comment
RekZ Posted June 17, 2020 Share Posted June 17, 2020 Server Side function onPlayerSpawn() if isElement(source) then -- Source here is the player if getTeamName(getPlayerTeam(source)) == "Red Team" then -- Team Name giveWeapon(source, 31, 500, true) -- Weapon elseif getTeamName(getPlayerTeam(source)) == "Blue Team" then -- Team Name giveWeapon(source, 30, 500, true) -- Weapon end end end addEventHandler("onPlayerSpawn", root, onPlayerSpawn) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now