I made a coffee script to change the name of the cup and the color and transparency of an invisible brick when it is touched to a certain machine. This worked fine until I realized I built it in experimental mode, when I changed it the script no longer worked. It works in studio but not in the actual game. The script is a normal script and not a local script if that helps. I don't get any errors either, I've tried looking at the pages for converting experimental to non-experimental for hours, trying remote events and functions, none of it worked. For some reason, the naming script works but not the brick color or transparency one. Here's an example script for the milk-steamer:
function makeLatte(cup) if cup.Parent.Name == "Espresso" then cup.Parent.Name = "Latte" cup.Parent.Drinkk.BrickColor = script.LatteColor.Value cup.Parent.Drinkk.Transparency = 0 end if cup.Parent.Name == "EmptyCup" then cup.Parent.Name = "SteamedMilk" cup.Parent.Drinkk.BrickColor = script.MilkColor.Value cup.Parent.Drinkk.Transparency = 0 end if cup.Parent.Name == "Chocolate Syrup" then cup.Parent.Name = "Hot Chocolate" cup.Parent.Drinkk.BrickColor = script.LatteColor.Value cup.Parent.Drinkk.Transparency = 0 end if cup.Parent.Name == "Chocolate Espresso" then cup.Parent.Name = "Mocha" cup.Parent.Drinkk.BrickColor = script.MochaColor.Value cup.Parent.Drinkk.Transparency = 0 end end script.Parent.Touched:Connect(makeLatte)
Any help is appreciated!
Change values to the colors name then add BrickColor.new()
and place the value inside the parenthesis:
cup.Parent.Drinkk.BrickColor = BrickColor.new(script.LatteColor.Value)
Edit:
function makeLatte(cup) print("makeLatte function fired") if cup.Parent.Name == "Espresso" then print("Espresso") cup.Parent.Name = "Latte" cup.Parent.Drinkk.BrickColor = script.LatteColor.Value cup.Parent.Drinkk.Transparency = 0 --end elseif cup.Parent.Name == "EmptyCup" then print("EmptyCup") cup.Parent.Name = "SteamedMilk" cup.Parent.Drinkk.BrickColor = script.MilkColor.Value cup.Parent.Drinkk.Transparency = 0 --end elseif cup.Parent.Name == "Chocolate Syrup" then print("Chocolate Syrup") cup.Parent.Name = "Hot Chocolate" cup.Parent.Drinkk.BrickColor = script.LatteColor.Value cup.Parent.Drinkk.Transparency = 0 --end elseif cup.Parent.Name == "Chocolate Espresso" then print("Chocolate Espresso") cup.Parent.Name = "Mocha" cup.Parent.Drinkk.BrickColor = script.MochaColor.Value cup.Parent.Drinkk.Transparency = 0 end end script.Parent.Touched:Connect(makeLatte)