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

Why isn't the noob spawning working for Red Team?

Asked by 5 years ago

Okay, I have a piece of code that does this:

script.Parent.Team.Changed:Wait()

if script.Parent.Parent.Name ~= "NoobContainer" then
    script.Parent:destroy()
end

if script.Parent.Team.Value == BrickColor.Red() then
    script.Parent.Torso.BrickColor = BrickColor.Red()
    script.Parent["Body Colors"].TorsoColor = BrickColor.Red()

    script.Parent["Left Leg"].BrickColor = BrickColor.Black()
    script.Parent["Body Colors"].LeftLegColor = BrickColor.Black()

    script.Parent["Right Leg"].BrickColor = BrickColor.Black()
    script.Parent["Body Colors"].RightLegColor = BrickColor.Black()
elseif script.Parent.Team.Value == BrickColor.Blue() then
    script.Parent.Torso.BrickColor = BrickColor.Blue()
    script.Parent["Body Colors"].TorsoColor = BrickColor.Blue()
else
    script.Parent:destroy()
end

There's a spawner that clones and changes their Team to BrickColor.Red() and BrickColor.Blue(). However, The above case doesn't even fire when it's red, it doesn't even flow down to destroying the model... I don't think it's a syntax error, but I'm stuck. Any help?

0
There's no guarantee that their brick color will be the exact brick color that BrickColor.Red() returns. If you don't assign it to the color it returns it won't execute. User#19524 175 — 5y
0
BrickColor.Red() is bright red, which I've set it to...unless BrickColor.Red() ~= BrickColor.Red().. or i'm missing soething dominoplayer6 -15 — 5y
0
BrickColor.new("Red") DeceptiveCaster 3761 — 5y
0
that forces Roblox to use Red and not Bright Red DeceptiveCaster 3761 — 5y
0
oh, i didn't know you could use strings inside brickcolor.new...tx dominoplayer6 -15 — 5y

Answer this question