Tool=script.Parent Handle=Tool:WaitForChild("\072\097\110\100\108\101")Players=game:GetService("\080\108\097\121\101\114\115")Sounds={CoilSound=Handle:WaitForChild("\067\111\105\108\083\111\117\110\100")}Gravity=196.2 JumpHeightPercentage=.12 ToolEquipped=false function GetAllConnectedParts(Q)local A={}local function P(Q)for Q,V in pairs(Q:GetConnectedParts())do local x=false for Q,A in pairs(A)do if V==A then x=true end end if not x then table.insert(A,V)P(V)end end end P(Q)return A end function SetGravityEffect()if not GravityEffect or not GravityEffect.Parent then GravityEffect=Instance.new("\066\111\100\121\070\111\114\099\101")GravityEffect.Name="\071\114\097\118\105\116\121\067\111\105\108\069\102\102\101\099\116"GravityEffect.Parent=Torso end local Q=0 local A=GetAllConnectedParts(Torso)for A,P in pairs(A)do if P:IsA("\066\097\115\101\080\097\114\116")then Q=Q+P:GetMass()end end local P=(Q*196.2)*(1-JumpHeightPercentage)GravityEffect.force=Vector3.new(0,P,0)end function HandleGravityEffect(Q)if not CheckIfAlive()then return end for Q,A in pairs(Torso:GetChildren())do if A:IsA("\066\111\100\121\070\111\114\099\101")then A:Destroy()end end for Q,A in pairs({ToolUnequipped,DescendantAdded;DescendantRemoving})do if A then A:disconnect()end end if Q then CurrentlyEquipped=true ToolUnequipped=Tool.Unequipped:connect(function()CurrentlyEquipped=false end)SetGravityEffect()DescendantAdded=Character.DescendantAdded:connect(function()wait()if not CurrentlyEquipped or not CheckIfAlive()then return end SetGravityEffect()end)DescendantRemoving=Character.DescendantRemoving:connect(function()wait()if not CurrentlyEquipped or not CheckIfAlive()then return end SetGravityEffect()end)end end function CheckIfAlive()return(Character and(Character.Parent and(Humanoid and(Humanoid.Parent and(Humanoid.Health>0 and(Torso and(Torso.Parent and(Player and Player.Parent))))))))and true or false end function Equipped(Q)Character=Tool.Parent Humanoid=Character:FindFirstChild("\072\117\109\097\110\111\105\100")Torso=Character:FindFirstChild("\084\111\114\115\111")or Character:FindFirstChild("\085\112\112\101\114\084\111\114\115\111")Player=Players:GetPlayerFromCharacter(Character)if not CheckIfAlive()then return end if HumanoidDied then HumanoidDied:disconnect()end HumanoidDied=Humanoid.Died:connect(function()if GravityEffect and GravityEffect.Parent then GravityEffect:Destroy()end end)Sounds.CoilSound:Play()HandleGravityEffect(true)ToolEquipped=true end function Unequipped()if HumanoidDied then HumanoidDied:disconnect()end HandleGravityEffect(false)ToolEquipped=false end Tool.Equipped:connect(Equipped)Tool.Unequipped:connect(Unequipped)
--model by CatLeoYT script--

Tool = script.Parent
Handle = Tool:WaitForChild("Handle")

Players = game:GetService("Players")

Sounds = {
	CoilSound = Handle:WaitForChild("CoilSound"),
}

Gravity = 196.20
JumpHeightPercentage = 0.12

ToolEquipped = false

function GetAllConnectedParts(Object)
	local Parts = {}
	local function GetConnectedParts(Object)
		for i, v in pairs(Object:GetConnectedParts()) do
			local Ignore = false
			for ii, vv in pairs(Parts) do
				if v == vv then
					Ignore = true
				end
			end
			if not Ignore then
				table.insert(Parts, v)
				GetConnectedParts(v)
			end
		end
	end
	GetConnectedParts(Object)
	return Parts
end

function SetGravityEffect()
	if not GravityEffect or not GravityEffect.Parent then
		GravityEffect = Instance.new("BodyForce")
		GravityEffect.Name = "GravityCoilEffect"
		GravityEffect.Parent = Torso
	end
	local TotalMass = 0
	local ConnectedParts = GetAllConnectedParts(Torso)
	for i, v in pairs(ConnectedParts) do
		if v:IsA("BasePart") then
			TotalMass = (TotalMass + v:GetMass())
		end
	end
	local TotalMass = (TotalMass * 196.20 * (1 - JumpHeightPercentage))
	GravityEffect.force = Vector3.new(0, TotalMass, 0)
end

function HandleGravityEffect(Enabled)
	if not CheckIfAlive() then
		return
	end
	for i, v in pairs(Torso:GetChildren()) do
		if v:IsA("BodyForce") then
			v:Destroy()
		end
	end
	for i, v in pairs({ ToolUnequipped, DescendantAdded, DescendantRemoving }) do
		if v then
			v:disconnect()
		end
	end
	if Enabled then
		CurrentlyEquipped = true
		ToolUnequipped = Tool.Unequipped:connect(function()
			CurrentlyEquipped = false
		end)
		SetGravityEffect()
		DescendantAdded = Character.DescendantAdded:connect(function()
			wait()
			if not CurrentlyEquipped or not CheckIfAlive() then
				return
			end
			SetGravityEffect()
		end)
		DescendantRemoving = Character.DescendantRemoving:connect(function()
			wait()
			if not CurrentlyEquipped or not CheckIfAlive() then
				return
			end
			SetGravityEffect()
		end)
	end
end

function CheckIfAlive()
	return (
		(
			(
				Character
				and Character.Parent
				and Humanoid
				and Humanoid.Parent
				and Humanoid.Health > 0
				and Torso
				and Torso.Parent
				and Player
				and Player.Parent
			) and true
		) or false
	)
end

function Equipped(Mouse)
	Character = Tool.Parent
	Humanoid = Character:FindFirstChild("Humanoid")
	Torso = Character:FindFirstChild("Torso") or Character:FindFirstChild("UpperTorso")
	Player = Players:GetPlayerFromCharacter(Character)
	if not CheckIfAlive() then
		return
	end
	if HumanoidDied then
		HumanoidDied:disconnect()
	end
	HumanoidDied = Humanoid.Died:connect(function()
		if GravityEffect and GravityEffect.Parent then
			GravityEffect:Destroy()
		end
	end)
	Sounds.CoilSound:Play()
	HandleGravityEffect(true)
	ToolEquipped = true
end

function Unequipped()
	if HumanoidDied then
		HumanoidDied:disconnect()
	end
	HandleGravityEffect(false)
	ToolEquipped = false
end

Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)
