function GetBaseSize()local v=Vector3.new(0,0,0)local N=Self.Size local u=Self:findFirstChild("\077\101\115\104")if u~=nil then v=Vector3.new(N.X*u.Scale.X,N.Y*u.Scale.Y,N.Z*u.Scale.Z)else v=N end return v end function GetBasePosition()local v=Vector3.new(0,0,0)local N=Self.Position local u=Self:findFirstChild("\077\101\115\104")if u~=nil then v=Vector3.new(N.X+u.Offset.X,N.Y+u.Offset.Y,N.Z+u.Offset.Z)else v=N end return v end local v=GetBaseSize()local N=GetBasePosition()function CheckMats(v)local N=false for u=1,#FloatMats,1 do if v.Material==Enum.Material[FloatMats[u]]then N=true end end return N end function isinArea(u)isIT=false if u~=nil then local j=v local a=u.Size local l=N local J=u.Position if J.Y+a.Y/2>l.Y-j.Y/2 and J.Y-a.Y/2<l.Y+j.Y/2 then if J.X+a.X/2>l.X-j.X/2 and J.X-a.X/2<l.X+j.X/2 then if J.Z+a.Z/2>l.Z-j.Z/2 and J.Z-a.Z/2<l.Z+j.Z/2 then isIT=true end end end end return isIT end while true do for u=1,#WorkSpaceObjects,1 do if WorkSpaceObjects[u]~=nil then if WorkSpaceObjects[u].Parent~=nil then if CheckMats(WorkSpaceObjects[u])==true then if WorkSpaceObjects[u]:findFirstChild("\066\111\121\097\110\099\121\084\105\109\101\115")~=nil then Mass=WorkSpaceObjects[u]:GetMass()*(230*WorkSpaceObjects[u].BoyancyTimes.Value)else Mass=WorkSpaceObjects[u]:GetMass()*230 end else Mass=WorkSpaceObjects[u]:GetMass()*150 end inArea=isinArea(WorkSpaceObjects[u])BoyantPos_Y=N.Y+v.Y/2 if inArea==true then if WorkSpaceObjects[u]:findFirstChild("\087\097\116\101\114\070\111\114\099\101")==nil then BP=Instance.new("\066\111\100\121\080\111\115\105\116\105\111\110")BP.Parent=WorkSpaceObjects[u]BP.Name="\087\097\116\101\114\070\111\114\099\101"if WorkSpaceObjects[u].Parent:findFirstChild("\072\117\109\097\110\111\105\100")~=nil then BP.D=12500.0 BP.P=100000.0 BP.position=Vector3.new(0,BoyantPos_Y+25,0)BP.maxForce=Vector3.new(0,Mass*1.5,0)else BP.D=1250.0 BP.P=10000.0 BP.position=Vector3.new(0,BoyantPos_Y,0)BP.maxForce=Vector3.new(0,Mass,0)end end if WorkSpaceObjects[u]:findFirstChild("\087\097\116\101\114\070\111\114\099\101")~=nil then if WorkSpaceObjects[u].Parent:findFirstChild("\072\117\109\097\110\111\105\100")~=nil then BP=WorkSpaceObjects[u].WaterForce if WorkSpaceObjects[u].Parent.Humanoid.Jump==true then BP.position=Vector3.new(0,BoyantPos_Y+50,0)BP.maxForce=Vector3.new(0,Mass*4,0)tick=tick+1 if tick>=resetTick then tick=0 WorkSpaceObjects[u].Parent.Humanoid.Jump=false end else BP.position=Vector3.new(0,BoyantPos_Y+1,0)BP.maxForce=Vector3.new(0,Mass*2,0)end end end else if WorkSpaceObjects[u]~=nil then if WorkSpaceObjects[u]:findFirstChild("\087\097\116\101\114\070\111\114\099\101")~=nil then WorkSpaceObjects[u].WaterForce:remove()end end end end end end wait()end
-- end of object table data
function GetBaseSize()
	local Size = Vector3.new(0, 0, 0)
	local mySize = Self.Size
	local Mesh = Self:findFirstChild("Mesh")
	if Mesh ~= nil then
		Size = Vector3.new((mySize.X * Mesh.Scale.X), (mySize.Y * Mesh.Scale.Y), (mySize.Z * Mesh.Scale.Z))
	else
		Size = mySize
	end
	return Size
end

function GetBasePosition()
	local Pos = Vector3.new(0, 0, 0)
	local myPos = Self.Position
	local Mesh = Self:findFirstChild("Mesh")
	if Mesh ~= nil then
		Pos = Vector3.new((myPos.X + Mesh.Offset.X), (myPos.Y + Mesh.Offset.Y), (myPos.Z + Mesh.Offset.Z))
	else
		Pos = myPos
	end
	return Pos
end
local AreaOfEffect = GetBaseSize()
local MyBasePos = GetBasePosition()
function CheckMats(part)
	local isBoyant = false
	for i = 1, #FloatMats do
		if part.Material == Enum.Material[FloatMats[i]] then
			isBoyant = true
		end
	end
	return isBoyant
end
function isinArea(part) --main function to check if parts are within an area
	isIT = false
	if part ~= nil then
		local Area = AreaOfEffect
		local PartSize = part.Size
		local MyPos = MyBasePos
		local PartPos = part.Position
		if
			(PartPos.Y + (PartSize.Y / 2) > MyPos.Y - (Area.Y / 2)) and (
				PartPos.Y - (PartSize.Y / 2) < MyPos.Y + (Area.Y / 2)
			)
		then
			if
				(PartPos.X + (PartSize.X / 2) > MyPos.X - (Area.X / 2))
				and (PartPos.X - (PartSize.X / 2) < MyPos.X + (Area.X / 2))
			then
				if
					(PartPos.Z + (PartSize.Z / 2) > MyPos.Z - (Area.Z / 2))
					and (PartPos.Z - (PartSize.Z / 2) < MyPos.Z + (Area.Z / 2))
				then -- should be in the volume
					isIT = true
				end
			end
		end
	end
	return isIT
end
while true do
	for i = 1, #WorkSpaceObjects do
		if WorkSpaceObjects[i] ~= nil then
			if WorkSpaceObjects[i].Parent ~= nil then
				if CheckMats(WorkSpaceObjects[i]) == true then
					if WorkSpaceObjects[i]:findFirstChild("BoyancyTimes") ~= nil then
						Mass = WorkSpaceObjects[i]:GetMass() * (230 * WorkSpaceObjects[i].BoyancyTimes.Value)
					else
						Mass = WorkSpaceObjects[i]:GetMass() * 230
					end
				else
					Mass = WorkSpaceObjects[i]:GetMass() * 150
				end
				inArea = isinArea(WorkSpaceObjects[i])
				BoyantPos_Y = MyBasePos.Y + (AreaOfEffect.Y / 2)
				if inArea == true then
					if WorkSpaceObjects[i]:findFirstChild("WaterForce") == nil then
						BP = Instance.new("BodyPosition")
						BP.Parent = WorkSpaceObjects[i]
						BP.Name = "WaterForce"
						if WorkSpaceObjects[i].Parent:findFirstChild("Humanoid") ~= nil then
							BP.D = 1.25e+004
							BP.P = 1e+005
							BP.position = Vector3.new(0, BoyantPos_Y + 25, 0)
							BP.maxForce = Vector3.new(0, Mass * 1.5, 0)
						else
							BP.D = 1.25e+003
							BP.P = 1e+004
							BP.position = Vector3.new(0, BoyantPos_Y, 0)
							BP.maxForce = Vector3.new(0, Mass, 0)
						end
					end
					if WorkSpaceObjects[i]:findFirstChild("WaterForce") ~= nil then
						if WorkSpaceObjects[i].Parent:findFirstChild("Humanoid") ~= nil then
							BP = WorkSpaceObjects[i].WaterForce
							if WorkSpaceObjects[i].Parent.Humanoid.Jump == true then
								BP.position = Vector3.new(0, BoyantPos_Y + 50, 0)
								BP.maxForce = Vector3.new(0, Mass * 4, 0)
								tick = tick + 1
								if tick >= resetTick then
									tick = 0
									WorkSpaceObjects[i].Parent.Humanoid.Jump = false
								end
							else
								BP.position = Vector3.new(0, BoyantPos_Y + 1, 0)
								BP.maxForce = Vector3.new(0, Mass * 2, 0)
							end
						end
					end
				else
					if WorkSpaceObjects[i] ~= nil then
						if WorkSpaceObjects[i]:findFirstChild("WaterForce") ~= nil then
							WorkSpaceObjects[i].WaterForce:remove()
						end
					end
				end
			end
		end
	end
	--print(#WorkSpaceObjects)
	wait()
end
