Cut me some slack because I am VERY new when it comes to scripting. Basically I have tried to create a script to change colors of my “gem” in the middle of my build but its not working. Any ideas as to why it isn’t working? An explanation would be valued over just showing the correct code.
local gem = game.Workspace.Gem
local function changegem()
gem.BrickColor = ("Dusty Rose")
wait(1)
gem.Brickcolor = ("Ghost Grey")
end
changegem()
Yeah so the issue here is the lines where you are trying to change the color.
The reason why your code does not work is because you are attempting to set a property to a string but it should be set to a BrickColor data type.
It just so happens BrickColor is the property name, but BrickColor on it’s own is a data type so BrickColor.new creates a new BrickColor instance that can be assigned to values that take BrickColor types.
To solve your issue you can do:
gem.BrickColor = BrickColor.new(“Color Name”)
Of course replace “Color Name” with the actual name of the color. And modify both lines where you try to change the color with this format also.