local E={}function getSeats(u)for u,z in pairs(u:GetChildren())do if z:IsA("\086\101\104\105\099\108\101\083\101\097\116")or z:IsA("\083\101\097\116")then local u={}u.Seat=z u.Parts={}table.insert(E,u)end getSeats(z)end end getSeats(bike)function getPProperties(E,u)for E,z in pairs(E:GetChildren())do if z:IsA("\066\097\115\101\080\097\114\116")then if z.CustomPhysicalProperties==nil then z.CustomPhysicalProperties=PhysicalProperties.new(z.Material)end table.insert(u,{z,z.CustomPhysicalProperties})z.CustomPhysicalProperties=PhysicalProperties.new(0,z.CustomPhysicalProperties.Friction,z.CustomPhysicalProperties.Elasticity,z.CustomPhysicalProperties.FrictionWeight,z.CustomPhysicalProperties.ElasticityWeight)end getPProperties(z,u)end end for E,u in pairs(E)do u.Seat.ChildAdded:connect(function(E)if E.Name=="\083\101\097\116\087\101\108\100"and(E:IsA("\087\101\108\100")and(E.Part1~=nil and(E.Part1.Parent~=workspace and not E.Part1.Parent:IsDescendantOf(bike))))then u.Parts={}getPProperties(E.Part1.Parent,u.Parts)end end)u.Seat.ChildRemoved:connect(function(E)if E.Name=="\083\101\097\116\087\101\108\100"and E:IsA("\087\101\108\100")then for E,u in pairs(u.Parts)do if u[1]~=nil and(u[2]~=nil and u[1]:IsDescendantOf(workspace))then u[1].CustomPhysicalProperties=u[2]end end u.Parts={}end end)end
--[[Remove Character Weight]]
--Get Seats
local Seats = {}
function getSeats(p)
	for i, v in pairs(p:GetChildren()) do
		if v:IsA("VehicleSeat") or v:IsA("Seat") then
			local seat = {}
			seat.Seat = v
			seat.Parts = {}
			table.insert(Seats, seat)
		end
		getSeats(v)
	end
end
getSeats(bike)

--Store Physical Properties/Remove Mass Function
function getPProperties(mod, t)
	for i, v in pairs(mod:GetChildren()) do
		if v:IsA("BasePart") then
			if v.CustomPhysicalProperties == nil then
				v.CustomPhysicalProperties = PhysicalProperties.new(v.Material)
			end
			table.insert(t, { v, v.CustomPhysicalProperties })
			v.CustomPhysicalProperties = PhysicalProperties.new(
				0,
				v.CustomPhysicalProperties.Friction,
				v.CustomPhysicalProperties.Elasticity,
				v.CustomPhysicalProperties.FrictionWeight,
				v.CustomPhysicalProperties.ElasticityWeight
			)
		end
		getPProperties(v, t)
	end
end

--Apply Seat Handler
for i, v in pairs(Seats) do
	--Sit Handler
	v.Seat.ChildAdded:connect(function(child)
		if
			child.Name == "SeatWeld"
			and child:IsA("Weld")
			and child.Part1 ~= nil
			and child.Part1.Parent ~= workspace
			and not child.Part1.Parent:IsDescendantOf(bike)
		then
			v.Parts = {}
			getPProperties(child.Part1.Parent, v.Parts)
		end
	end)

	--Leave Handler
	v.Seat.ChildRemoved:connect(function(child)
		if child.Name == "SeatWeld" and child:IsA("Weld") then
			for i, v in pairs(v.Parts) do
				if v[1] ~= nil and v[2] ~= nil and v[1]:IsDescendantOf(workspace) then
					v[1].CustomPhysicalProperties = v[2]
				end
			end
			v.Parts = {}
		end
	end)
end
