How can I check if a players is using jump power or jump height?

I’m trying to change a player’s jump Height/Power, and I want it to work for both. But my check system isn’t working, have a look

	if Humanoid.JumpHeight then
			Humanoid:SetAttribute("OriginJumpHeight", Humanoid.JumpHeight)
			print(Humanoid.JumpHeight)
		else
			Humanoid:SetAttribute("OriginJumpHeight", Humanoid.JumpPower)
			print(Humanoid.JumpPower)
		end

Does anyone have an idea of how I can do this?

1 Like

image

The “CharacterUseJumpPower” property under StarterPlayer.

1 Like

you could use :GetPropertyChangedSignal() to check whenever the property jump changes

1 Like

Are you saying to check if the player’s character is using jump power? with the boolean UseJumpPower

No, but if that property is enabled player’s characters will only ever use JumpPower instead of JumpHeight.

Yes, I know this. But I want to use this script without the hassle while pasting it into other games, that might use jump height. Hence why I’m checking for both. Or if the players settings change midgame

local Players = game:GetService("Players")
local DefaultJumpPower = 50
local DefaultJumpHeight = 7.2

Players.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function(Character)
		local Humanoid = Character:WaitForChild("Humanoid")
		Humanoid.JumpPower = DefaultJumpPower * 2
		Humanoid.JumpHeight = DefaultJumpHeight * 2
	end)
end)

Doubles the jumping magnitude for both jump types.

Hey let me give some more info, Since this could break if I use this for what I want to do.

if Humanoid.UseJumpPower == false then
			Humanoid:SetAttribute("OriginJumpHeight", Humanoid.JumpHeight)
		else
			Humanoid:SetAttribute("OriginJumpHeight", Humanoid.JumpPower)
		end

This adds attributes to my character
image

image
as you can see the jump height is set to 50, but my character is using jump height and not jump power, so it should equal 7.2 . And I use these attributes for most of my scripts. so that every script can change it

I found out why this code above doesn’t work. I’m using a custom character, so even if I set the characters setting on jump power to false it stays true. Do you know how i would fix this

if Humanoid.UseJumpPower == false then