local sp = script.Parent local waterSound = sp.Water local emitter = sp.Water.ParticleEmitter function Faucet() print("3") if emitter.Enabled then print("3=2") emitter.Enabled = false waterSound:Stop() else print("32") emitter.Enabled = true waterSound:Play() end end sp.Faucet.ClickDetector.MouseClick:connect(Faucet)
Error: Water is not a valid member of Model
the script's parent is the model and inside the model is Water and Faucet
Hello, try this. It worked in my studio perfectly
local det = script.Parent.ClickDetector local ep = script.Parent.ParticleEmitter local sp = script.Parent.Water det.MouseClick:connect(function() print('3') if ep.Enabled == false then print('3=2') ep.Enabled = true sp:Play() else print('32') sp:Stop() ep.Enabled = false end end)
I hope this helps you out! Edit: this is a ServerScript inside the model