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
 

how to use getplayers with a team

Previous Thread :: Next Thread 
Fangous is not online. Fangous
Joined: 03 Jul 2010
Total Posts: 4448
26 Jun 2016 10:23 PM
repeat
wait()
local players = game.Teams.Playing:GetPlayers()
until #players == 1
print("1 player")

error:
23:21:36.941 - Team:GetPlayers() is disabled
23:21:36.941 - Script 'Workspace.CONTROLLER', Line 126
23:21:36.941 - Stack End
Report Abuse
TheBenSquare is not online. TheBenSquare
Joined: 13 Dec 2009
Total Posts: 13604
26 Jun 2016 10:24 PM
It hasn't been enabled yet so you can't do it with that function.
Report Abuse
Fangous is not online. Fangous
Joined: 03 Jul 2010
Total Posts: 4448
26 Jun 2016 10:26 PM
how could i do this?
Report Abuse
TheBenSquare is not online. TheBenSquare
Joined: 13 Dec 2009
Total Posts: 13604
26 Jun 2016 10:28 PM
Create your own function that'll return an array of people that are on that team. Do so by iterating through all of the players and comparing their TeamColor to a certain TeamColor. If it's a match, insert the player into a table that is created at the beginning of the function. Once you've finished the iterations, return the table.
Report Abuse
DevVince is not online. DevVince
Joined: 08 Nov 2008
Total Posts: 9245
26 Jun 2016 10:29 PM
:)
https://www.roblox.com/Team-Functions-item?id=440435752


Report Abuse
Fangous is not online. Fangous
Joined: 03 Jul 2010
Total Posts: 4448
26 Jun 2016 10:45 PM
thanks :)
Report Abuse
Fangous is not online. Fangous
Joined: 03 Jul 2010
Total Posts: 4448
26 Jun 2016 10:46 PM
oh devvince i didnt see ur post i just did it like the other one said. it was a little hacky for me but i figured it out
Report Abuse
DevVince is not online. DevVince
Joined: 08 Nov 2008
Total Posts: 9245
26 Jun 2016 10:47 PM
Mine includes two functions.

One gets the players on that team and one returns all teams with all players on each one.


Report Abuse
j_ffrey is not online. j_ffrey
Joined: 12 Apr 2015
Total Posts: 262
26 Jun 2016 10:48 PM
dev always has a model for everything hes that cool


Report Abuse
DevVince is not online. DevVince
Joined: 08 Nov 2008
Total Posts: 9245
26 Jun 2016 10:50 PM
I just made scripts I post a lot into models so it's easier because people ask for the same type a lot.


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