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)
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