Ad
Log in to vote
0

BrickColor.new Doesn't Work For Simple Script?

Asked by 2 months ago
Edited 2 months ago

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)
0
i think the incorrect thing you have done is that you spelled the color Lily white, incorrectly saSlol2436 324 — 2mo
0
I checked and I have also tried alternative colors. BunnyFilms1 138 — 2mo
0
Your spelling them wrong. H4X0MSYT 193 — 2mo
0
This baffles me. Ran it in my world and it worked fine. Try restarting studio. lukeb50 456 — 2mo
View all comments (3 more)
0
Alrighty, thanks for the tip :) BunnyFilms1 138 — 2mo
1
This might be dumb to ask, but was the object that collided named "Part"? Goulstem 7591 — 1mo
0
You can also try using a code instead of the name. 348 (http://wiki.roblox.com/index.php?title=BrickColor_codes) kools 259 — 1mo

Hi.

Looks like you're using an ad blocker.

That's fine...

No, it really is.

Just, I mean, we put a lot of work into this site, you know?

It would be really really appreciated if you would turn off your ad blocker for our website...

We tried really hard to make our ads as unobtrusive as possible.

If you really hate ads, would you consider a $2 donation via Patreon?

Here's the link.

We love you. We hope you love us too.

.

..

...

Now back to your regularly scheduled Scripting Helpers....

...

..

.

Answer this question



Ad