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

How do I make this brick change color according to a player's team?

Asked by 9 years ago
button = script.Parent
IsRaid = game.Workspace.IsRaid

function capture(plr)
    IsRaid.Value = true
    if plr.TeamColor == "Bright blue" then
        button.BrickColor = BrickColor.new("Bright blue")
    elseif plr.TeamColor == "Bright red" then
        button.BrickColor = BrickColor.new("Bright red")
    end
end

script.Parent.ClickDetector.MouseClick:connect(capture)

I am using this script as a raid terminal and I want this brick to change color and match the teamcolor of the player who clicked it. I was told that if you put something in the parentheses, it is a name for the player who clicked in this situation.

Do I have to word it a different way or change the way I write it?

1 answer

Log in to vote
0
Answered by
wjs3456 90
9 years ago

You have to do:

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

That way it will know what "Bright blue" is.

Hope this helped.

0
Oh okay I will try that. I thought I remembered seeing something like that I just needed to find out the specfics. PureDefiance 20 — 9y
0
Cool. It has worked for me in similar situations. Tell me if you need other help wjs3456 90 — 9y
0
Alright that worked great, the button works now, now for the capture process. I probably will need a lot of help but I will post them in separate questions. PureDefiance 20 — 9y
0
Haha that's fun part right glad to help. If you want you can accept the answer(Translation: we both get better rep if you do. :)) wjs3456 90 — 9y
Ad

Answer this question