local I=game:GetService("\082\117\110\083\101\114\118\105\099\101")local b=script.Parent local V=b:WaitForChild("\072\117\109\097\110\111\105\100")local p=b:WaitForChild("\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116")local h I.Heartbeat:Connect(function()if p.Position.Y<Sea.Position.Y-p.Size.Y/2 then if not h then h=Instance.new("\066\111\100\121\086\101\108\111\099\105\116\121")h.Parent=p end h.Velocity=V.MoveDirection*V.WalkSpeed+Vector3.new(0,4,0)if V:GetState()~=Enum.HumanoidStateType.Swimming then V:SetStateEnabled(Enum.HumanoidStateType.GettingUp,false)V:ChangeState(Enum.HumanoidStateType.Swimming)end elseif h and p.Position.Y<Sea.Position.Y then h.Velocity=V.MoveDirection*V.WalkSpeed elseif h then h:Destroy()h=nil V:SetStateEnabled(Enum.HumanoidStateType.GettingUp,true)end end)
--
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)
