Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to make an if statement with a teamcolor?

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)

1 comment

0

The second word cannot be captial

1 answer

✓ Accepted answer
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)

3 comments

0

The second word cannot be a capital

0

Thanks!

0

updated while u were typing ^^

This discussion is preserved as it was. New answers, comments, and votes are closed.