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: Please help me

Previous Thread :: Next Thread 
Venitel is not online. Venitel
Joined: 28 Jul 2012
Total Posts: 706
13 Dec 2012 07:58 PM
local Players=game:service("Players"):GetPlayers()
for v=1, #Players do
if (Players[v]:IsInGroup(123123)) and (Players[v].TeamColor==BrickColor.new("Bright red")) then
Players[v].TeamColor=BrickColor.new("Cyan")
elseif (Players[v].TeamColor==game.Teams["Raiders"].TeamColor)
Players[v].TeamColor=BrickColor.new("Bright green")
for _,v in pairs(game.Players:GetChildren()) do
if v.Character then
v.Character:BreakJoints()
end
end
end
end


Everytime this script is enabled then it changed my team to neutral. and yes. I am in 123123 group (SC)

I am wanting this script to do this.

When enabled,

Any person in SC(123123) on the team "Raiders" (Bright red) to be changed to the team SC (Cyan) and if they are on the Raiders team but not in SC then to change to "Friendlies" (Bright green). and then kills everyone.


Thanks!
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
13 Dec 2012 07:59 PM
You forgot a then on the elseif line.

¤ † KMXD† ¤
Report Abuse
Venitel is not online. Venitel
Joined: 28 Jul 2012
Total Posts: 706
13 Dec 2012 08:01 PM
local Players=game:service("Players"):GetPlayers()
for v=1, #Players do
if (Players[v]:IsInGroup(123123)) and (Players[v].TeamColor==BrickColor.new("Bright red")) then
Players[v].TeamColor=BrickColor.new("Cyan")
elseif (Players[v].TeamColor==game.Teams["Raiders"].TeamColor) then
Players[v].TeamColor=BrickColor.new("Bright green")
for _,v in pairs(game.Players:GetChildren()) do
if v.Character then
v.Character:BreakJoints()
end
end
end
end



still didn't work with then there
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
13 Dec 2012 08:04 PM
Move an end to after changing the raiders to the green team.

¤ † KMXD† ¤
Report Abuse
Venitel is not online. Venitel
Joined: 28 Jul 2012
Total Posts: 706
13 Dec 2012 08:05 PM
So..

local Players=game:service("Players"):GetPlayers()
for v=1, #Players do
if (Players[v]:IsInGroup(123123)) and (Players[v].TeamColor==BrickColor.new("Bright red")) then
Players[v].TeamColor=BrickColor.new("Cyan")
elseif (Players[v].TeamColor==game.Teams["Raiders"].TeamColor) then
Players[v].TeamColor=BrickColor.new("Bright green")
end
for _,v in pairs(game.Players:GetChildren()) do
if v.Character then
v.Character:BreakJoints()
end
end
end



like that?
Report Abuse
Venitel is not online. Venitel
Joined: 28 Jul 2012
Total Posts: 706
13 Dec 2012 08:07 PM
If so, then no... it didn't ):
Report Abuse
blueboy167thst is not online. blueboy167thst
Joined: 24 Nov 2012
Total Posts: 106
13 Dec 2012 08:11 PM
game:GetService("Players")
not
game:service("Players")
Report Abuse
Venitel is not online. Venitel
Joined: 28 Jul 2012
Total Posts: 706
13 Dec 2012 08:16 PM
Nope, it still changes me to neutral
Report Abuse
Venitel is not online. Venitel
Joined: 28 Jul 2012
Total Posts: 706
13 Dec 2012 08:18 PM
local Players=game:GetService("Players"):GetPlayers()
for v=1, #Players do
if (Players[v]:IsInGroup(123123)) and (Players[v].TeamColor==BrickColor.new("Bright red")) then
Players[v].TeamColor=BrickColor.new("Cyan")
elseif (Players[v].TeamColor==BrickColor.new("Bright red")) then
Players[v].TeamColor=BrickColor.new("Bright green")
for _,v in pairs(game.Players:GetChildren()) do
if v.Character then
v.Character:BreakJoints()
end
end
end
end



I don't know if the end at the end of the elseif line did anything
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
13 Dec 2012 08:43 PM
Try moving two ends up there, one for the condition, the other the loop.

¤ † KMXD† ¤
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