Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to check TeamColor?

Asked by 10 years ago
local vCharacter = Tool.Parent
local vPlayer = game.Players:playerFromCharacter(vCharacter)

if vPlayer.TeamColor == "Bright blue" then
    print(vPlayer.TeamColor)
end     

Why wont this print, i have checked it over and over. It should work and print "Bright blue" but it dosent. Please help

1 answer

Log in to vote
1
Answered by
Kratos232 105
10 years ago

The Property thing TeamColor isn't a String Value, It's a BrickColor. You've been calling it as if it was a String. It should be

if vPlayer.TeamColor == BrickColor.new("Bright blue") then

Making the Overall Script...

local vCharacter = Tool.Parent
local vPlayer = game.Players:playerFromCharacter(vCharacter)

if vPlayer.TeamColor == BrickColor.new("Bright blue") then
    print(vPlayer.TeamColor)
end     

Well, it should be...

Hope this helps, and actually works...

  • Kratos232
0
oh i should of know that, thanks :) +1 and accepted NinjoOnline 1146 — 10y
Ad

Answer this question