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!

8 comments
Is the script getting destroyed before you make a latte? Is the script being disabled?
Nope, the naming script works still but not the brick color/transparency one for some reason.
Are LatteColor, MilkColor, and MochaColor BrickColorValue's?
Yep, they are.
Add calls to the print function At the top of the function (inside it) add a call to print, something like print("Touched") and inside your if statements, to make sure the code is actually running.
add a print to the first line in the function then add more inside the if statements. Btw you can use elseif instead of having to create another if statement. I'll edit my answer so you'll see what I mean.
Btw, include any code that changes the "cup" name.
Thanks awesome, it prints and I don't get any errors, but the brick inside only changes color and transparency in studio, not the game itself. I don't know if it's an issue with server/client information but I don't think I should need to use remote events/functions for this? I'm not sure though.