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

Can anyone help with a script where when a player jumps the player jump power increases?

I already have a script but it isnt working can anyone help me with it? Im putting it inside a gear idk if i should put it somewhere else.

local userInputService = game:GetService("UserInputService")

function jumpRequest() humanoid.JumpPower = humanoid.Jumppower + 1 end

2 comments

0

what do you mean by putting it in "a gear"

0

I made an item ingame so when they hold it the script is active

1 answer

local userInputService = game:GetService("UserInputService")
local equipped = false
local player = game.Players.LocalPlayer
local character = player.Character 
local humanoid = character.Humanoid

script.Parent.Equipped:Connect(function() --tools have an equipped and unequipped function. You can use these functions to detect if the player has the tool equipped or not
	equipped = true
end)

script.Parent.Unequipped:Connect(function()
	equipped = false
end)

userInputService.JumpRequest:Connect(function()
	if humanoid.Health > 0 then --check if the humanoid is alive
		humanoid.JumpPower += 1 --increases jump power by 1
	end
end)

I haven't tested this code so let me know if you run into any issues.

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