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

Color Changing Help?

Asked by
22To 70
9 years ago

Ok I made a brick color changer for when a part touch it , it changes the part color but instead of changing the parts colors its changing the color of the brick color changer itself and leaving the parts with no color change

function onTouched(part)
wait(0.2)
script.Parent.BrickColor = BrickColor.new("Bright blue")
wait(0.2)
script.Parent.BrickColor = BrickColor.new("Bright violet")
wait(0.2)
script.Parent.BrickColor = BrickColor.new("Bright orange")
wait(0.2)
script.Parent.BrickColor = BrickColor.new("Pastel blue-green")
wait(0.2)
script.Parent.BrickColor = BrickColor.new("Sand blue")
wait(0.2)
script.Parent.BrickColor = BrickColor.new("Br. yellowish orange")
wait(0.2)
script.Parent.BrickColor = BrickColor.new("Grime")
wait(0.2)
script.Parent.BrickColor = BrickColor.new("Pastel blue")
wait(0.2)
end
script.Parent.Touched:connect(onTouched)

0
Add a Debounce so that your code doesn't fire multiples on execution. TheeDeathCaster 2368 — 9y
0
where do i add the debounce? 22To 70 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

From what is looks like, you should make it

part.BrickColor = BrickColor.new("Pastel blue")

Instead of

script.Parent.BrickColor = BrickColor.new("Pastel blue")

The reason being that script.Parent is most likely the color changer, and part is the part you want to color.

0
I'll Try Right now 22To 70 — 9y
0
the parts start randomly flashing 22To 70 — 9y
1
The wait you used may be too short. Another thing to consider s adding debounce. Darkwisp 5 — 9y
0
how to add a debounce? 22To 70 — 9y
Ad

Answer this question