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 » Scripters
Home Search
 

Re: How do i do things with teamcolor?

Previous Thread :: Next Thread 
Ueskay is not online. Ueskay
Joined: 20 Jun 2014
Total Posts: 824
02 Aug 2017 09:35 PM
I'm trying to make a gui that tells you what job you have.
I don't know what to do to have a script read teamcolor.

Heres what i have so far:

local Player = game.Players.LocalPlayer
local Character = Player.Character
Text = script.Parent


function JobReader()
if Player.TeamColor == ("Burlap") then
Text.Text = "JOB: CITIZEN"
elseif Player.TeamColor.BrickColor == BrickColor.new("Lime green") then
Text.Text = "JOB: GUN DEALER"
end
end

while true do
wait(0.01)
JobReader()
end
Report Abuse
TheeDeathCaster is online. TheeDeathCaster
Joined: 19 Jun 2011
Total Posts: 1191
02 Aug 2017 09:38 PM
Think of `TeamColor` as a `BrickColor` value; From there, there's your answer. :)
Report Abuse
Ueskay is not online. Ueskay
Joined: 20 Jun 2014
Total Posts: 824
02 Aug 2017 09:40 PM
So, then that means i should try teamcolor.Brickcolor??

or do i do, player.brickcolor?
Report Abuse
Alend43 is not online. Alend43
Joined: 13 Nov 2013
Total Posts: 451
02 Aug 2017 09:41 PM
Instead of burlap and lime green, use the Color3 Value (The Numbers beside the color)

Should work
Report Abuse
TheeDeathCaster is online. TheeDeathCaster
Joined: 19 Jun 2011
Total Posts: 1191
02 Aug 2017 09:41 PM
`if player.TeamColor == BrickColor.new('Bright blue') then`
Report Abuse
HoodedBlack is not online. HoodedBlack
Joined: 04 May 2013
Total Posts: 2226
02 Aug 2017 09:42 PM
local Player = game.Players.LocalPlayer
local Character = Player.Character
Text = script.Parent


function JobReader()
if Player.TeamColor == BrickColor.new("Burlap") then
Text.Text = "JOB: CITIZEN"
elseif Player.TeamColor == BrickColor.new("Lime green") then
Text.Text = "JOB: GUN DEALER"
end
end

while true do
wait(0.01)
JobReader()
end

whenever using a teamcolor, you use BrickColor.COLOR() or BrickColor.new("COLOR")
Report Abuse
systematicaddict is not online. systematicaddict
Joined: 13 Jul 2012
Total Posts: 4188
02 Aug 2017 09:44 PM
Is it just me, or can you not call GetPropertyChangedSignal() on TeamColor?

I tried on studio and it didn't work lol
Report Abuse
Ueskay is not online. Ueskay
Joined: 20 Jun 2014
Total Posts: 824
02 Aug 2017 09:47 PM
Black, you're method did not work. it still does not display my job.
Report Abuse
HoodedBlack is not online. HoodedBlack
Joined: 04 May 2013
Total Posts: 2226
02 Aug 2017 09:53 PM
Show me the error
Report Abuse
Ueskay is not online. Ueskay
Joined: 20 Jun 2014
Total Posts: 824
02 Aug 2017 09:55 PM
BrickColorValue is not a valid member of BrickColor
Report Abuse
Invisibull is not online. Invisibull
Joined: 19 Jul 2016
Total Posts: 1865
02 Aug 2017 09:56 PM
local Player = game.Players.LocalPlayer
local Character = Player.Character
Text = script.Parent

function onButtonClicked()
if Player.TeamColor == ("Burlap") then
Text.Text = "JOB: CITIZEN"
elseif Player.TeamColor.BrickColor == ("Lime green") then
Text.Text = "JOB: GUN DEALER"
end
end

Text.MouseButton1Down:connect(onButtonClicked)



Report Abuse
Ueskay is not online. Ueskay
Joined: 20 Jun 2014
Total Posts: 824
02 Aug 2017 09:59 PM
This isn't a button its a text label
Report Abuse
Ueskay is not online. Ueskay
Joined: 20 Jun 2014
Total Posts: 824
02 Aug 2017 10:01 PM
If you want to help me, join me in my game ill tell you problems i have with my game.

https://www.roblox.com/games/387407627/DawnRP-Crime-Spree
Report Abuse
systematicaddict is not online. systematicaddict
Joined: 13 Jul 2012
Total Posts: 4188
02 Aug 2017 10:04 PM
Ignore my last post, but, instead of doing this in an ugly while loop, you should just do this:

plr:GetPropertyChangedSignal("TeamColor"):Connect(function()
JobReader()
end)
Report Abuse
Ueskay is not online. Ueskay
Joined: 20 Jun 2014
Total Posts: 824
02 Aug 2017 10:07 PM
2 Errors:

BrickColorValue is not a valid member of BrickColor

BrickColor is not a valid member of BrickColor




Heres my script now:


local plr = game.Players.LocalPlayer
local Character = plr.Character
Text = script.Parent

function JobReader()
if plr.TeamColor == ("Burlap") then
Text.Text = "JOB: CITIZEN"
elseif plr.TeamColor.BrickColor == ("Lime green") then
Text.Text = "JOB: GUN DEALER"
end
end

plr:GetPropertyChangedSignal("TeamColor"):Connect(function()
JobReader()
end)
Report Abuse
systematicaddict is not online. systematicaddict
Joined: 13 Jul 2012
Total Posts: 4188
02 Aug 2017 10:19 PM
if plr.TeamColor == BrickColor.new("Burlap") then

elseif plr.TeamColor == BrickColor.new("Lime green") then

change those two lines
Report Abuse
TheeDeathCaster is online. TheeDeathCaster
Joined: 19 Jun 2011
Total Posts: 1191
02 Aug 2017 10:28 PM
@OP Dude, did you srs not read our past posts about `TeamColor`s and `BrickColor`s? >>:/
Report Abuse
Ueskay is not online. Ueskay
Joined: 20 Jun 2014
Total Posts: 824
02 Aug 2017 10:42 PM
I just did that, it didn't work.

i got the same error "BrickColorValue is not a valid member of BrickColor"


new script:




local plr = game.Players.LocalPlayer
local Character = plr.Character
Text = script.Parent

function JobReader()
if plr.TeamColor == BrickColor.new("Burlap") then
Text.Text = "JOB: CITIZEN"
elseif plr.TeamColor == BrickColor.new("Lime green") then
Text.Text = "JOB: GUN DEALER"
end
end

plr:GetPropertyChangedSignal("TeamColor"):Connect(function()
JobReader()
end)
Report Abuse
Ueskay is not online. Ueskay
Joined: 20 Jun 2014
Total Posts: 824
02 Aug 2017 10:48 PM
bump
Report Abuse
Invisibull is not online. Invisibull
Joined: 19 Jul 2016
Total Posts: 1865
03 Aug 2017 02:32 AM
do u need the BrickColor[.new] part?
Report Abuse
Ueskay is not online. Ueskay
Joined: 20 Jun 2014
Total Posts: 824
03 Aug 2017 03:05 AM
Read the script, you will see what is required.

The - Brickcolor.new is required because thats what checks if its on a certain team.
Report Abuse
Ueskay is not online. Ueskay
Joined: 20 Jun 2014
Total Posts: 824
05 Aug 2017 11:21 AM
bump
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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