generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Limit a Team to 1 player.

Previous Thread :: Next Thread 
louisdemon1 is not online. louisdemon1
Joined: 30 Sep 2008
Total Posts: 240
18 Dec 2016 05:00 PM
Can somebody tell me?
Report Abuse
booing is not online. booing
Joined: 04 May 2009
Total Posts: 6594
18 Dec 2016 05:04 PM
Tell you what?
Report Abuse
louisdemon1 is not online. louisdemon1
Joined: 30 Sep 2008
Total Posts: 240
18 Dec 2016 05:07 PM
how that works , please.
Report Abuse
CWRA0444 is online. CWRA0444
Joined: 14 Jan 2010
Total Posts: 6013
18 Dec 2016 05:08 PM
Just manually assign teams to players on-player-enter(?)
Report Abuse
louisdemon1 is not online. louisdemon1
Joined: 30 Sep 2008
Total Posts: 240
18 Dec 2016 05:09 PM
I want the players to join the team from a gui but limit the team to 1 player only
Report Abuse
CWRA0444 is online. CWRA0444
Joined: 14 Jan 2010
Total Posts: 6013
18 Dec 2016 05:12 PM
players = game.Players:getPlayers()
teams = game.Teams:getTeams()
for i = 1, #teams do
for i = 1, #players do
onTeam = {}
if players[i].TeamColor = team[x].TeamColor then
table.Insert(onTeam, players[i])
end
if #onTeam > 1 then
blah blah blah
end
end
end
Report Abuse
CWRA0444 is online. CWRA0444
Joined: 14 Jan 2010
Total Posts: 6013
18 Dec 2016 05:13 PM
There are a couple of errors in that code, but that's the idea. You do the math.
Report Abuse
louisdemon1 is not online. louisdemon1
Joined: 30 Sep 2008
Total Posts: 240
18 Dec 2016 05:14 PM
Alright , thanks
Report Abuse
louisdemon1 is not online. louisdemon1
Joined: 30 Sep 2008
Total Posts: 240
18 Dec 2016 05:17 PM
Did I solve it properly?

players = game.Players:getPlayers()
teams = game.Teams:getTeams()

for x = 1, #teams do
for i = 1, #players do
onTeam = {"Disk Joker"}
if players[i].TeamColor == teams[x].TeamColor then
table.Insert(onTeam, players[i])
end
if #onTeam > 1 then
end
end
end
Report Abuse
CWRA0444 is online. CWRA0444
Joined: 14 Jan 2010
Total Posts: 6013
18 Dec 2016 05:20 PM
The script I gave you was just a general idea. Here are some tips.
Leave onTeam empty, because if theres anything inside onTeam it means theres already a player in that team, in which case you would write code where "blah blah blah" is. Otherwise, the GUI should let the player join the empty team.
Report Abuse
CWRA0444 is online. CWRA0444
Joined: 14 Jan 2010
Total Posts: 6013
18 Dec 2016 05:21 PM
Wiki article on tables:
http://wiki.roblox.com/index.php?title=Table
Report Abuse
CWRA0444 is online. CWRA0444
Joined: 14 Jan 2010
Total Posts: 6013
18 Dec 2016 05:22 PM
"For" loops:
http://wiki.roblox.com/index.php?title=Loops#For
Report Abuse
louisdemon1 is not online. louisdemon1
Joined: 30 Sep 2008
Total Posts: 240
18 Dec 2016 05:37 PM
still cant figure it out to mee the loops seems fine and I just cant seem to know where to add the Team to limit it.

players = game.Players:GetPlayers()
teams = game.Teams:GetTeams()

for x = 1, #teams do
for i = 1, #players do
onTeam = {}
if players[i].TeamColor == teams[x].TeamColor["Electric blue"] then
table.Insert(onTeam, teams[x])
end
if onTeam == 1 then
print("Hello!")
end
end
end
Report Abuse
louisdemon1 is not online. louisdemon1
Joined: 30 Sep 2008
Total Posts: 240
18 Dec 2016 07:26 PM
~Bump~

Still need help
Report Abuse
Xstarlight is not online. Xstarlight
Joined: 18 Oct 2012
Total Posts: 870
18 Dec 2016 07:28 PM
Im not sure, but i believe if you just make the max amount of players equal to the amount of teams that Roblox itself will balance the teams out.
Report Abuse
louisdemon1 is not online. louisdemon1
Joined: 30 Sep 2008
Total Posts: 240
18 Dec 2016 07:34 PM
I want to make a button that would make the player able to join the team but there'd be a limit of 1 player in that team at a time
Report Abuse
louisdemon1 is not online. louisdemon1
Joined: 30 Sep 2008
Total Posts: 240
18 Dec 2016 07:40 PM
~Bumb~
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image