So I was wondering how I could possibly change the brick color of a drink in it When put in the machine?? This is the script I have right now? Any help?
function tch(h)
if (h.Parent.Name == "Cup") then
script.Parent.Sound:Play()
game.Workspace.ChocolateMachine.Spill.Transparency = 0
h.Parent.Name = "Chocolate Ice Cream"
wait(0.5)
game.Workspace.ChocolateMachine.Spill.Transparency = 1
h.Parent.Drink.BrickColor = script.Color.Value
h.Parent.Drink.Transparency = 0
end
end
script.Parent.Touched:connect(tch)
So I have my Brick named Drink when a cup get's touched on the part Brick It will change a brick in the cup that was touched to a certain color and the spill is the ice cream dropping
I want it to change the color of the drink in workspace when playing the game so If someone puts their cup in the machine their Drink will turn brown or something?
-Glassify

5 comments
could you use the "code block" format and put the code in that?reading the code as-is is impossible
Agree. Too hard. But do you want the whole cup to change color?
How Do you do that?
before putting your code into the post,click the button with the LUA logo and paste the code inside lines it creates
Make everything a union. it will be easier for your life