How to Make Underwater Effects in Roblox Studio (Easy

Аватар автора
Геймерский Дайджест
Script: local WS = game:GetService("Workspace") local Lighting = game:GetService("Lighting") local Terrain = WS:WaitForChild("Terrain") local Camera = WS:WaitForChild("Camera") Camera:GetPropertyChangedSignal("CFrame"):Connect(function() local Region = Region3.new(Vector3.new(Camera.CFrame.X - 2, Camera.CFrame.Y - 2, Camera.CFrame.Z - 2), Vector3.new(Camera.CFrame.X + 2, Camera.CFrame.Y + 2, Camera.CFrame.Z + 2)) Region = Region:ExpandToGrid(4) local Material = Terrain:ReadVoxels(Region, 4) Material = Material[1][1][1] if Material == Enum.Material.Water then if not Lighting:FindFirstChild("WaterBlur") then local Blur = Instance.new("BlurEffect", Lighting) Blur.Name = "WaterBlur" Blur.Size = 0 local CC = Instance.new("ColorCorrectionEffect", Lighting) CC.Name = "WaterColorCorrection" spawn(function() for i = 0, 15 do Blur.Size = i CC.TintColor = Color3.new(1 - .038 * i, 1 - .027 * i, 1 - .014 * i) wait() end end) end else if Lighting:FindFirstChild("WaterBlur") then Lighting.WaterBlur.Name = "WaterBlurTweening" local CC = Lighting.WaterColorCorrection spawn(function() for i = 15, 0, -1 do Lighting.WaterBlurTweening.Size = i Lighting.WaterColorCorrection.TintColor = Color3.new(1 - .038 * i, 1 - .027 * i, 1 - .014 * i) wait() end Lighting.WaterBlurTweening:Destroy() Lighting.WaterColorCorrection:Destroy() end) end end end) --Big Thanks To mboy789 for the script-...

0/0


0/0

0/0

0/0