Changing water transparency

So I have a button that changes water transparency. It is not working, and no errors.
So heres the basic explorer:
StarterGui>ScreenGui>Frame>Water>localscript:
script.Parent.MouseButton1Down:Connect(function()
workspace.Terrain.WaterTransparency = 1
end)

Could you be more clear? What exactly isn’t working, if theirs no errors you need to explain what you want to happen and what isn’t happening otherwise no one knows what the logic error can be.

So basically, this script is supposed to make the water transparent if you click a button:
script.Parent.MouseButton1Down:Connect(function()
workspace.Terrain.WaterTransparency = 1
end)

Though when I click it, water stays the same. Nothing happens.

could you take screen shots of the script and the locations of “Water” and the “localscript” in the explorer

also the code should be like this

script.Parent.MouseButton1Down:Connect(function()
	workspace.Terrain.Water.Transparency = 1
end)

not sure if the missing “.” inbetween water and Transparency is something you are missing in your actual script

Is it in a clickDetector? If not, that’s the problem.

If it is a Player Sided GUI, you need to use remote events. This is because you are trying to change something on the serverside with a local script. You can use your local script to fire a remote event, then you can pick up that event with a normal script. Hope I was clear here. If you need more explaining feel free to @ me.

1 Like

Is the Terrain Water Transparency value changing in the Properties window? Check the number when you test it to see if the value changes. If it doesn’t then manually change it to see if you notice a difference.
There is also the issue of not having your Studio Graphics setting up around 21 or your Player Graphics not as high as possible (10) when you test it. If these values aren’t above a certain value then Water Transparency changes don’t actually make a difference because your computer isn’t displaying the Transparency optimally.

The issue is probably your graphics aren’t high enough.

Graphics were not high enough, thanks guys :smiley:

1 Like