I have a soda machine that only works when FilteringEnabled is disabled. It uses a Surface GUI to select the flavor you want and a part that you touch your cup to in order to fill the cup. Here is one of the flavor selection scripts:
local CurrentFlavor = script.Parent.Parent.Parent.Parent.CurrentFlavor
local Pour = script.Parent.Parent.Parent.Parent.Pour
local light = script.Parent.Parent.Parent.Parent.Parent.Parent.Light
function fill()
light.BrickColor = BrickColor.new("Lime green")
CurrentFlavor.Value = "Coke"
Pour.TextBox.Text = " Ready To Pour "..CurrentFlavor.Value.."..."
Pour.Visible = true
wait(5)
light.BrickColor = BrickColor.new("Institutional white")
Pour.Visible = false
CurrentFlavor.Value = "Nothing"
end
script.Parent.MouseButton1Click:Connect(fill)
CurrentFlavor: The String Value that tells a touched event what drink to pour.
Pour: The frame that appears when you have selected a flavor.
Light: The light that turns green when you have selected a flavor.
Here is part of the touched part script:
local CupName = "Empty Glass"
local CurrentFlavor = script.Parent.Parent.Screen.SurfaceGui.CurrentFlavor
local spill = script.Parent.Spill
function hit(hit)
if CurrentFlavor.Value == "Coke" and hit.Parent.Name == CupName then
spill.BrickColor = BrickColor.new("Cocoa")
spill.Transparency = 0
wait(1)
hit.Parent.Drink.BrickColor = BrickColor.new("Cocoa")
hit.Parent.Drink.Transparency = 0
hit.Parent.Name = "Coke"
spill.Transparency = 1
end
end
script.Parent.Touched:Connect(hit)
There are a bunch of elseifs for the other drink flavors.
Thanks!

6 comments
Thanks! I know a bit about remote events, yet the scripts that I tried only work for Screen GUIs and not Surface GUIs :/
So, you want a soda machine as a 2d GUI?
The screen is basically like a touch screen.
Just because the second method works fine with FE set on in the properties window doesn't mean your game is secure. Turning on the option FE doesn't give you any security benefits.
That is why you must use RE and RF.
I got it working. I inserted a Click Detector to bring up a Screen Gui, then used a Remote Event to select the flavor.