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 |
|
|
|
| 02 Aug 2017 09:38 PM |
| Think of `TeamColor` as a `BrickColor` value; From there, there's your answer. :) |
|
|
| Report Abuse |
|
|
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
|
  |
| 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 |
|
|
|
| 02 Aug 2017 09:41 PM |
| `if player.TeamColor == BrickColor.new('Bright blue') then` |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
| |
|
Ueskay
|
  |
| Joined: 20 Jun 2014 |
| Total Posts: 824 |
|
|
| 02 Aug 2017 09:55 PM |
| BrickColorValue is not a valid member of BrickColor |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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
|
  |
| Joined: 20 Jun 2014 |
| Total Posts: 824 |
|
| |
|
|
| 03 Aug 2017 02:32 AM |
| do u need the BrickColor[.new] part? |
|
|
| Report Abuse |
|
|
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
|
  |
| Joined: 20 Jun 2014 |
| Total Posts: 824 |
|
| |
|