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

How to make an if statement with a teamcolor?

Asked by 5 years ago
Edited 5 years ago

This doesn't work, how do I fix it?

local RS = game:GetService("ReplicatedStorage")
RS.RemoteEvent.OnServerEvent:Connect(function(hit)
    local check = hit.Character:FindFirstChild("Humanoid")
    if check then
        if hit.TeamColor == ("Lime Green") then
            hit.TeamColor = Color3.new("Really Red")
        end
    end
end)
0
The second word cannot be captial Ziffixture 6913 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago
local RS = game:GetService("ReplicatedStorage")
RS.RemoteEvent.OnServerEvent:Connect(function(hit)
    local check = hit.Character:FindFirstChild("Humanoid")
    if check then
        if hit.TeamColor == BrickColor.new("Lime green") then --use brickcolor. notice how the second word is lowercase
            hit.TeamColor = BrickColor.new("Really red") --not color3
        end
    end
end)
0
The second word cannot be a capital Ziffixture 6913 — 5y
0
Thanks! ProjectJager 62 — 5y
0
updated while u were typing ^^ Gey4Jesus69 2705 — 5y
Ad

Answer this question