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: A small question about TeamColor

Previous Thread :: Next Thread 
yoshiwars is not online. yoshiwars
Joined: 27 Jul 2009
Total Posts: 216
13 Feb 2014 08:11 PM
Why this doesn't work?

if player.TeamColor == BrickColor("Bright red") then
--code
end
Report Abuse
ridiculessam28 is not online. ridiculessam28
Joined: 10 Sep 2010
Total Posts: 728
13 Feb 2014 08:13 PM
Try:
if player.TeamColor = "Bright red" then

end
Report Abuse
dodleman is not online. dodleman
Joined: 22 Dec 2007
Total Posts: 1118
13 Feb 2014 08:15 PM
omg

if player.TeamColor == BrickColor.new("Bright red") then
stuff
end
Report Abuse
yoshiwars is not online. yoshiwars
Joined: 27 Jul 2009
Total Posts: 216
13 Feb 2014 08:27 PM
(Above) not working :/
Report Abuse
Azarth is not online. Azarth
Joined: 17 Aug 2012
Total Posts: 2760
13 Feb 2014 08:28 PM
Then their TeamColor isn't what you specified or player is nil.
Report Abuse
dodleman is not online. dodleman
Joined: 22 Dec 2007
Total Posts: 1118
13 Feb 2014 08:28 PM
Actually it does work thank you. Post your script skid.
Report Abuse
yoshiwars is not online. yoshiwars
Joined: 27 Jul 2009
Total Posts: 216
13 Feb 2014 08:35 PM
(the whole thing)


red = game.Lighting.red
blue = game.Lighting.blue

game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
if character:findFirstChild("Shirt") ~= nil then
character.Shirt:Remove()
end
if character:findFirstChild("Pants") ~= nil then
character.Pants:Remove()
end
if player.TeamColor == BrickColor.new("Bright red") then
rs = red.Shirt:Clone()
rp = red.Pants:Clone()
rs.Parent = character
rp.Parent = character
elseif player.TeamColor == BrickColor.new("Bright blue") then
bs = blue.Shirt:Clone()
bp = blue.Pants:Clone()
bs.Parent = character
bp.Parent = character
end
end)
end)
Report Abuse
dodleman is not online. dodleman
Joined: 22 Dec 2007
Total Posts: 1118
13 Feb 2014 08:39 PM
CharacterAdded doesn't always work when the player arrives. Kill the player when they enter or make a separate function and call it when they arrive and when they CharacterAdded
Report Abuse
COOLDUDE11OO is not online. COOLDUDE11OO
Joined: 21 Aug 2011
Total Posts: 5115
13 Feb 2014 08:47 PM
player = game.Players.LocalPlayer

if player.TeamColor == BrickColor.new("Bright red") then
--code
end

or

game.Players.PlayerAdded:connect(function(player)
if player.TeamColor == BrickColor.new("Bright red") then
--code
end)
Report Abuse
yoshiwars is not online. yoshiwars
Joined: 27 Jul 2009
Total Posts: 216
13 Feb 2014 09:06 PM
I did this and its working but the thing is after death it stops working

-------------------------------------------------------------------------
player = game.Players.LocalPlayer
character = player.Character
red = game.Lighting.red
blue = game.Lighting.blue

function uni()
if character:findFirstChild("Shirt") ~= nil then
character.Shirt:Remove()
end
if character:findFirstChild("Pants") ~= nil then
character.Pants:Remove()
end
if player.TeamColor == BrickColor.new("Bright red") then
rs = red.Shirt:Clone()
rp = red.Pants:Clone()
rs.Parent = character
rp.Parent = character
elseif player.TeamColor == BrickColor.new("Bright blue") then
bs = blue.Shirt:Clone()
bp = blue.Pants:Clone()
bs.Parent = character
bp.Parent = character
end

end
uni()
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