Humanoid.JumpPower not changing

I’m working on a round-based game and this function below is a gamemode. The problem is, changing the humanoid.JumpPower does nothing. I’ve considered network ownership and using remote events to change it on the client but I don’t see how the answer to my issue could be that. I remember when I changed the humanoids’ properties with no issues.

function NoJump:Start(runners)
	for i,player in pairs(runners) do
		local character = player.Character or player.CharacterAdded:Wait()
		local humanoid = character:FindFirstChild("Humanoid") or character:WaitForChild("Humanoid")
		humanoid.JumpPower = 0
		humanoid.Died:Connect(function()
			humanoid.JumpPower = 50
		end)
	end
end

runners is a variable that contains players who are in a round

This gamemode works to unenable jumping and re-enable it when the game is over.

3 Likes

Umm, I assume you have Enabled Jump Power over Jump Height in the Game settings?
Or enabled Jump power on the Player rather than jump height…

Untitled-1

2 Likes

don’t you have to do runners:GetChildren() or runners:GetDescendants() (not sure which one) ? Unless runners is a table

1 Like

Try using this instead:

function NoJump:Start(runners)
	for _, player in pairs(runners) do
		local character = player.Character or player.CharacterAdded:Wait()
		local humanoid = character:WaitForChild("Humanoid")
		humanoid.JumpPower = 0
		
		local function resetJumpPower()
			humanoid.JumpPower = 50
		end
		humanoid.Died:Connect(resetJumpPower)
		humanoid.StateChanged:Connect(function(oldState, newState)
			if newState == Enum.HumanoidStateType.Seated then
				resetJumpPower()  -- (optional)
			end
		end)
	end
end

1 Like

Yeah it worked, I just enabled Jump Power over Jump Height in the Game Settings, I don’t know why Roblox would make Jump Height the first to be enabled in Game Settings > World.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.