Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to make weight of jump decrease gradually on button hold?

So what would be the most efficient way to make weight of a jump decrease gradually on button hold?

Go to 2:47 of this video , it shows a good example of what I'm trying to say.

https://www.youtube.com/watch?v=99wx0FfnzH8&feature=youtu.be

I look at this and I would have no idea if I need to make a for i loop or something else for the gradually decreasing jump weight.

game.Players.PlayerAdded:connect(function(p)
p.CharacterAdded:connect(function(c)
b = Instance.new("BodyForce") 
b.maxForce = Vector3.new(0,c:getMass()*100,0) 
b.Parent = c.Torso
end)
end)

2 comments

0

If you want it press&release then player jumps, it's possible and easy, I can help you. If you want it to fall down as soon as you release space, then it is not much possible without a confusing script.

0

@superalp1111 Yeah jump on button hold, fall on release.

1 answer

you can actually just make it so that the longer you hold a button the humanoid's jump decreases

For a quick example;

local jump = game.Players.LocalPlayer:WaitForChild("Humanoid")
local button = script.Parent

button.MouseButton1Down:connect(function()
	jump.JumpPower = jump.JumpPower -1
end)

This may or may not work, I didn't test but I hope you get the idea.

This discussion is preserved as it was. New answers, comments, and votes are closed.