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)

2 comments
I'm a very beginner at scripting ,I understand but can't do.
you connected a function to an object