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

How to change color onEnter help?

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 comment

1

Check your capitalization. I don't think the "G" in "green" is supposed to be capitalized in Lua.

1 answer

✓ Accepted answer

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

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