r=game:service("\082\117\110\083\101\114\118\105\099\101")Tool=script.Parent local X=196.66666666667 local N=.75 local K=nil local V=nil local f=nil local q=nil function recursiveGetLift(K)local V=0 local f=K:GetChildren()if K:FindFirstChild("\072\101\097\100")~=nil then q=K:FindFirstChild("\072\101\097\100")end for K=1,#f,1 do if f[K].className=="\080\097\114\116"then if q~=nil and(f[K].Position-q.Position).magnitude<10 then if f[K].Name=="\072\097\110\100\108\101"then V=V+(f[K]:GetMass()*X)*1 else V=V+(f[K]:GetMass()*X)*N end end end V=V+recursiveGetLift(f[K])end return V end function onMassChanged(X,N)if K~=nil then K.force=Vector3.new(0,recursiveGetLift(N),0)end end function UpdateGhostState(X)if X==true then K:Remove()K=nil V:disconnect()f:disconnect()else if K==nil then local X=Tool.Parent if X==nil then return end K=Instance.new("\066\111\100\121\070\111\114\099\101")K.Name="\071\114\097\118\105\116\121\067\111\105\108\069\102\102\101\099\116"K.force=Vector3.new(0,recursiveGetLift(X),0)K.Parent=X.Head ghostChar=X V=X.ChildAdded:connect(function(N)onMassChanged(N,X)end)f=X.ChildRemoved:connect(function(N)onMassChanged(N,X)end)end end end function onEquipped()Tool.Handle.CoilSound:Play()UpdateGhostState(false)end function onUnequipped()UpdateGhostState(true)end script.Parent.Equipped:connect(onEquipped)script.Parent.Unequipped:connect(onUnequipped)
-------- OMG HAX

r = game:service("RunService")

Tool = script.Parent

local equalizingForce = 236 / 1.2 -- amount of force required to levitate a mass
local gravity = 0.75 -- things float at > 1

local ghostEffect = nil
local massCon1 = nil
local massCon2 = nil

local head = nil
function recursiveGetLift(node)
	local m = 0
	local c = node:GetChildren()
	if node:FindFirstChild("Head") ~= nil then
		head = node:FindFirstChild("Head")
	end -- nasty hack to detect when your parts get blown off

	for i = 1, #c do
		if c[i].className == "Part" then
			if head ~= nil and (c[i].Position - head.Position).magnitude < 10 then -- GROSS
				if c[i].Name == "Handle" then
					m = m + (c[i]:GetMass() * equalizingForce * 1) -- hack that makes hats weightless, so different hats don't change your jump height
				else
					m = m + (c[i]:GetMass() * equalizingForce * gravity)
				end
			end
		end
		m = m + recursiveGetLift(c[i])
	end
	return m
end

function onMassChanged(child, char)
	if ghostEffect ~= nil then
		ghostEffect.force = Vector3.new(0, recursiveGetLift(char), 0)
	end
end

function UpdateGhostState(isUnequipping)
	if isUnequipping == true then
		ghostEffect:Remove()
		ghostEffect = nil
		massCon1:disconnect()
		massCon2:disconnect()
	else
		if ghostEffect == nil then
			local char = Tool.Parent
			if char == nil then
				return
			end
			ghostEffect = Instance.new("BodyForce")
			ghostEffect.Name = "GravityCoilEffect"
			ghostEffect.force = Vector3.new(0, recursiveGetLift(char), 0)
			ghostEffect.Parent = char.Head
			ghostChar = char
			massCon1 = char.ChildAdded:connect(function(child)
				onMassChanged(child, char)
			end)
			massCon2 = char.ChildRemoved:connect(function(child)
				onMassChanged(child, char)
			end)
		end
	end
end

function onEquipped()
	Tool.Handle.CoilSound:Play()
	UpdateGhostState(false)
end

function onUnequipped()
	UpdateGhostState(true)
end

script.Parent.Equipped:connect(onEquipped)
script.Parent.Unequipped:connect(onUnequipped)
