How can I disable jumping while climbing?

When running the script on the player, and setting the bool value “bunny” to true, i cant jump anymore, I need some help solving this issue.

The problem that I want to solve is that when climbing some part, it stops jumping when the bool “bunny” is true.

Here is the LocalScript (In StarterCharacterScripts) :

local val = game.ReplicatedStorage.Values.Poderes.Bunny
local salto = game.ReplicatedStorage.Values.Poderes.Salto
local hum = script.Parent.Humanoid

while task.wait(.1) do
	if hum:GetState(Enum.HumanoidStateType.Climbing) then
		if val.Value == false then
			if salto.Value == false then
				hum.JumpPower = 50
			else
				hum.JumpPower = 65
			end
		else
			hum.JumpPower = 0
		end
	end
end

Try changing line 3 to local hum = script.Parent:WaitForChild(“Humanoid”)

It doesn’t work, it make the error worse

Not exactly, I wanted the humanoid not to jump while climbing

Are you supposed the change the value of the ‘bunny’ in the script? I don’t understand when it is and isn’t true because the script does not have anything that changes the value

the value of “bunny” is true when I activate a remote event, but it has nothing to do with the script that I put in the post