I’m trying to make realistic water flow, but I’m stuck and I get no errors.
local function getmidcframe(cframe1, cframe2)
local cframe = cframe1:lerp(cframe2,0.5)
return cframe
end
while true do
local c = Vector3.new(workspace.Water.WaterMain.Position.X, 0, 0)
local d = Vector3.new(workspace.Water.WaterMini.Position.X, 0, 0)
local a = Vector3.new(0, workspace.Water.WaterMain.Position.Y, 0)
local b = Vector3.new(0, workspace.Water.WaterMini.Position.Y, 0)
local e = Vector3.new(0, 0, workspace.Water.WaterMain.Position.Z)
local f = Vector3.new(0, 0, workspace.Water.WaterMini.Position.Z)
local size = Vector3.new((c - d).magnitude,(a - b).magnitude,(e - f).magnitude)
local WorkS = game.Workspace
WorkS.Terrain:FillBlock(getmidcframe(workspace.Water.WaterMini.CFrame,workspace.Water.WaterMain.CFrame),size,Enum.Material.Water)
wait(0.1)
WorkS.Terrain:Clear()
end