Hello there! Do you have an answer? I have a problem! You see? I have a script, and it works... for the most part. But why is the color not changing when the brick collides? It does though change the material so I am confused! Did I mess up?

function onTouched(hit)

if hit.Name == "Part" then
hit.BrickColor = BrickColor.new("Lily white")
	hit.Material = "Sand"

end
end

connection = script.Parent.Touched:connect(onTouched)

7 comments

0

i think the incorrect thing you have done is that you spelled the color Lily white, incorrectly

0

I checked and I have also tried alternative colors.

0

Your spelling them wrong.

0

This baffles me. Ran it in my world and it worked fine. Try restarting studio.

0

Alrighty, thanks for the tip :)

1

This might be dumb to ask, but was the object that collided named "Part"?

0

You can also try using a code instead of the name. 348 (http://wiki.roblox.com/index.php?title=BrickColor_codes)