In ROBLOX Studio, I was editing a faucet to make it dispense water using trancperency changes via script and Click Detector. It said there was an error on Line 1. Please tell me what's wrong with the script.
function hotWater(onClicked) if script.Parent.Parent.Water.Transparency = 0.48 then script.Parent.Parent.Water.Transparency = 0 end else script.Parent.Parent.Water.Transparency = 0.48 end script.Parent.ClickDetector:connect(onClicked)
-- Replace your last line where you call the script to be executed to this.
script.Parent.ClickDetector.MouseClick:connect(HotWater)
-- HotWater is the name of your function and you do not need the arguments "onClicked"