I used this code to make the underwater effect but it printed out: 09:28:23.834 - Players.david73754.PlayerScripts.Water.CameraInWaterFX:82: attempt to index nil with 'Humanoid'
if Water ~= nil then
FisheyeEffectAlpha = FisheyeEffectAlpha + deltaTime / FisheyeEffectCycleDuration
FisheyeEffectAlpha = FisheyeEffectAlpha - math.floor(FisheyeEffectAlpha)
humCamOffset = humCamOffset + Vector3.new(math.sin(tick() * 3) * 0.2, math.sin(tick() * 3.21) * 0.2, math.sin(tick() * 3.73) * 0.2)+ Vector3.new(math.sin(tick() * 3) * 0.2, math.sin(tick() * 3.21) * 0.2, math.sin(tick() * 3.73) * 0.2)
local camoffs = humCamOffset + Vector3.new(math.sin(tick() * 3) * 0.2, math.sin(tick() * 3.21) * 0.2, math.sin(tick() * 3.73) * 0.2)+ Vector3.new(math.sin(tick() * 3) * 0.2, math.sin(tick() * 3.21) * 0.2, math.sin(tick() * 3.73) * 0.2)
player.Humanoid.CameraOffset = camoffs
end
end)
I used this code to make the underwater effect, it didn't work.

2 comments
This looks like some obfuscated stuff. pls clean ur code
how do i clean my code?