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

How to change color of Drink Brick?

Asked by 8 years ago

Im trying to make it change the color inside of a cup in game when I touch the machine for example touching a milk carton will fill the cup in your hand with milk?? Any help

function tch(h)
if (h.Parent.Name == "Iced Vanilla") then
script.Parent.Sound:Play()
h.Parent.Name = "Iced Vanilla Milk"
wait(0.5)
h.Parent.Handle.Brickcolor = script.Color.Value
h.Parent.Drink.BrickColor = script.Color.Value
h.Parent.Drink.Transparency = 0
end
end

script.Parent.Touched:connect(tch)

0
How does your current code not meet your expectations? Goulstem 8144 — 8y
0
? Glassify 15 — 8y

1 answer

Log in to vote
-2
Answered by 8 years ago

I'm not sure if this is your issue, but you are forgetting Brickcolor.new which defines what you want to change

Try this out:

function tch(h)
if (h.Parent.Name == "Iced Vanilla") then
script.Parent.Sound:Play()
h.Parent.Name = "Iced Vanilla Milk"
wait(0.5)
h.Parent.Handle.Brickcolor = Brickcolor.new("Brown")
h.Parent.Drink.BrickColor = Brickcolor.new("Brown")
h.Parent.Drink.Transparency = 0
end
end


0
If it's a BrickColorValue, this will error. Tkdriverx 514 — 8y
0
It didn't work can you make it say the brick color like brown instead of script.Color.Value Glassify 15 — 8y
0
Like that? User#9949 0 — 8y
Ad

Answer this question