Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you make a 'team full' function script? [closed]

Asked by
Yukogan 72
4 years ago

Please include the code which you are trying to use, so the community will be better-equipped to help you with your problem.

Hi! I'm making a game with teams where the players can choose their team, but I don't want that one team has 10 players and one team 2 players.

Does someone know what script I need to make it?

PS: If my English is bad, It's because I'm from another country.

0
@programmerHere is rude User#23252 26 — 4y
0
Not rude, there is no attempt. Don't be stupid programmerHere 371 — 4y

Closed as Not Constructive by programmerHere, Just2Terrify, CeramicTile, User#23252, and royaltoe

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
-2
Answered by 4 years ago

the following should work

local  team;
int  max_players_on_team = 10;

if (#team:GetPlayers() > max_players_on_team)
    cout<<"Team full";
else
    cout<<"team not full";
end
0
sorrym change `cout<<x;` to print(x), and `int` to local.. I've ben coding quite a lot in C++ lately and I am tired AF, so sorry for the C++ syntax User#23252 26 — 4y
0
-1 for confusing user with syntax from other languages, he knows absolutely nothing, for spoonfeeding and for excluding braces from control structures programmerHere 371 — 4y
Ad