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 » Scripting Helpers
Home Search
 

Re: How do I refer to whether or not a player is on a certain team?

Previous Thread :: Next Thread 
sonichedgie is not online. sonichedgie
Joined: 22 Mar 2008
Total Posts: 4279
05 Mar 2012 04:44 PM
game.player.team ?
Report Abuse
sonichedgie is not online. sonichedgie
Joined: 22 Mar 2008
Total Posts: 4279
05 Mar 2012 04:45 PM
game.Players.player.team.TEAMNAME ?
Report Abuse
grimm343 is not online. grimm343
Joined: 18 Sep 2008
Total Posts: 2796
05 Mar 2012 04:45 PM
if game.Players.sonichedgie.TeamColor == game.Teams["Teamname"].TeamColor then
--st00f
end
Report Abuse
sonichedgie is not online. sonichedgie
Joined: 22 Mar 2008
Total Posts: 4279
05 Mar 2012 04:49 PM
Not a specific player. Any player thats on that team.
Report Abuse
07lchris is not online. 07lchris
Joined: 28 Feb 2010
Total Posts: 1603
05 Mar 2012 04:59 PM
InTeam = {} -- Table with players' names in Bright red team
TeamColor = "Bright red"

for i,v in pairs(game.Players:GetChildren()) do
if v.TeamColor == TeamColor then
table.insert(InTeam, v.Name)
end
end
Report Abuse
grimm343 is not online. grimm343
Joined: 18 Sep 2008
Total Posts: 2796
05 Mar 2012 05:13 PM
Or..

InTeam = {}

function FPiT(tname)
InTeam = {}
for _,v in pairs(game.Players:GetPlayers()) do
if v.TeamColor == game.Teams[tname].TeamColor then
table.insert(InTeam,v.Name)
end
end
end



With this script, you can call the function to work with any team name.
You can call it by using...

FPiT("This is an example team name")
Report Abuse
WiseNoobCrusher is not online. WiseNoobCrusher
Joined: 22 Dec 2010
Total Posts: 42
05 Mar 2012 07:50 PM
here,s a challenge, how do you make a team changer gui that when it,s equal, when you press it you wont be able to change, huh?
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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