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: Not working...

Previous Thread :: Next Thread 
Amaz619305316 is not online. Amaz619305316
Joined: 27 Jul 2010
Total Posts: 2014
17 Mar 2012 05:19 PM
function: Killed()
local c=game.Players:GetChildren()
for i=1,#c do
if c[i].TeamColor == game.Teams.Red.TeamColor then
c[i].TeamColor = game.Teams.Blue.TeamColor
elseif c[i].TeamColor == game.Teams.Blue.TeamColor then
c[i].TeamColor = game.Teams.Red.TeamColor
end
end
end

Killed()

Basicly if a player on Red kills a player on Blue then a random person from the team Blue Jail will change team and be on team red again.
Report Abuse
jimmybolt77 is not online. jimmybolt77
Joined: 06 Jul 2008
Total Posts: 292
17 Mar 2012 05:27 PM
function Killed() -- Don't put a :
local c = game.Players:GetChildren()
for i=1,#c do
if c[i].TeamColor == game.Teams.Red.TeamColor then
c[i].TeamColor = game.Teams.Blue.TeamColor
elseif c[i].TeamColor == game.Teams.Blue.TeamColor then
c[i].TeamColor = game.Teams.Red.TeamColor
end
end
end

Killed()
Report Abuse
Amaz619305316 is not online. Amaz619305316
Joined: 27 Jul 2010
Total Posts: 2014
17 Mar 2012 05:31 PM
Ty. And can you change it so when a player on Red kills a Player on Blue a random player on Blue Jail goes back to team Red?
Report Abuse
jimmybolt77 is not online. jimmybolt77
Joined: 06 Jul 2008
Total Posts: 292
17 Mar 2012 05:35 PM
Sorry, I don't know how.. xP
Report Abuse
jimmybolt77 is not online. jimmybolt77
Joined: 06 Jul 2008
Total Posts: 292
17 Mar 2012 05:39 PM
I found something on a forum post. So, I'll try.
Report Abuse
jimmybolt77 is not online. jimmybolt77
Joined: 06 Jul 2008
Total Posts: 292
17 Mar 2012 05:40 PM
local p = Game.Players:GetPlayers()
local rp = p[math.random(#p)
--put event here

I'll let you do it >:D
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