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

How to change color onEnter help?

Asked by 10 years ago

I have got the rotation part right. When someone joins the game, the rotation changes. But the color does not. It changes to "Dark Stone Gray". I got this answer from DevFrank... here it is,

local leaf = script.Parent
local colors = {"Pastel Green", "Bright Green", "Medium Green", "Sand Green"}

game.Players.PlayerAdded:connect(function()
    leaf.CFrame = CFrame.new(leaf.CFrame.x, leaf.CFrame.y, leaf.CFrame.z) * CFrame.Angles(math.random(), math.random(), math.random())
    leaf.BrickColor = BrickColor.new(colors[math.random(1, #colors)])
end)

Please find out what is wrong with the colors.

1
Check your capitalization. I don't think the "G" in "green" is supposed to be capitalized in Lua. SlickPwner 534 — 10y

1 answer

Log in to vote
3
Answered by 10 years ago

In colors the second word is never capitalized. So it would be {"Pastel green", "Bright green", etc}

Ad

Answer this question