Help creating a jump power/graviy script

I want to make it so when the tool is equipped, whenever the player jumps, their gravity is reduced and they can jump higher.

Script:

function jump()
local Game = game
local Workspace = workspace
local Players = Game:GetService("Players")
local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:FindFirstChildOfClass("Humanoid") or Character:WaitForChild("Humanoid")
local RootPart = Humanoid.RootPart or Humanoid:GetPropertyChangedSignal("RootPart"):Wait()
if not RootPart then RootPart = Humanoid.RootPart end
local Mass = 0
for _, Descendant in ipairs(Character:GetDescendants()) do
	if not (Descendant:IsA("BasePart")) then continue end
	Mass += Descendant:GetMass()
end
local BodyForce = Instance.new("BodyForce")
BodyForce.Force = Vector3.new(0, Mass / 2 * Workspace.Gravity, 0)
BodyForce.Parent = RootPart
end

local plr = game.Players.LocalPlayer
local char = plr.Character:WaitForChild("Humanoid")

local tool = script.Parent

if tool.Equipped then
	char.JumpPower = 100
	char.Jumped:Connect(jump)
end
1 Like

Not sure if this would work but could you maybe change the player’s mass instead?

I’m pretty sure you’re talking about gravity coils, you can check the scripts inside them and see how they work.

But to make your own script, you can just check for Tool.Equipped on a local script and then increase gravity for that player. Then on Tool.UnEquipped, you can just change the gravity back.