How do I make a part that the player can swim in?

If you have heard of Robot 64, you can swim in a part that is just water, how can I do the same thing?

Instead of creating a part, you can use the terrain editor to generator realistic water and swimming animations

^

Thats what I don’t wanna do.

I don’t like using that terrain system, especially with my type of game.

I want to make a part that I can make into water.

Here is a script I found to do this:

local Sea = workspace.Sea --Directory of the water part
--
local RS = game:GetService("RunService")
local Character = script.Parent
local Humanoid = Character:WaitForChild("Humanoid")
local Root = Character:WaitForChild("HumanoidRootPart")
local Swim


RS.Heartbeat:Connect(function()
	if Root.Position.Y < Sea.Position.Y - Root.Size.Y / 2 then
		if not Swim then
			Swim = Instance.new("BodyVelocity")
			Swim.Parent = Root
		end
		Swim.Velocity = Humanoid.MoveDirection * Humanoid.WalkSpeed + Vector3.new(0,4,0)
		if Humanoid:GetState() ~= Enum.HumanoidStateType.Swimming then
			Humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, false)
			Humanoid:ChangeState(Enum.HumanoidStateType.Swimming)
		end
	elseif Swim and Root.Position.Y < Sea.Position.Y then
		Swim.Velocity = Humanoid.MoveDirection * Humanoid.WalkSpeed
	elseif Swim then
		Swim:Destroy()
		Swim = nil
		Humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, true)
	end
end)

This isn’t very helpful, because Im not sure how this script even works, and I don’t know where you got it from, Is there like a function or something that I can use to make a part emulate the already made Roblox Water?

This is the original post, which explains it:

https://devforum.roblox.com/t/how-to-create-terrain-water-behavior-without-terrain-water/579536/12