How to disable jumping?

How do I disable jumping? Like no jumping, period. I need them to be in the sitting position at all times/ If the player tries to jump it should put them in the sit position, or a way to remove jumping from the game (trying to jump with space or with the button on mobile will not do anything) would work even better

This is what I have:

game.Players.PlayerAdded:Connect(function(p)
	p.CharacterAdded:Connect(function(char)
		local Humanoid = char:FindFirstChild("Humanoid")
		if Humanoid then
			Humanoid.Sit = true
			Humanoid.Jumping:Connect(function()
				Humanoid.Jump = false
				Humanoid.Sit = true
			end)
		end
	end)
end)

(JumpPower is already set to 0 in the game/world settings)
Obviously it’s not doing as intended. When you jump it does not sit you back down.

4 Likes

Hi there you just have to make Humanoid.JumpPower to 0 or JumpHeight

1 Like

✓ Possible Solution


• Humanoid State

Set the players jumping state off then they can’t jump. You can do this with a lot more than just jumping. See the list by typing Enum.HumanoidStateType

Humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)

7 Likes

You could possibly use this? Not sure if this is what you wanted:

game.Players.PlayerAdded:Connect(function(p)
	p.CharacterAdded:Connect(function(char)
		local Humanoid = char:FindFirstChild("Humanoid")
		if Humanoid then
			Humanoid.Sit = true
			Humanoid.Jumping:Connect(function()
				Humanoid.Jump = false
				Humanoid.Sit = true
				Humanoid.Changed:Connect(function()
					if Humanoid.Sit == false then
						Humanoid.Sit = true
					end
				end)
			end)
		end
	end)
end)

If this isn’t the solution, try this, it seems to be more efficient:

game.Players.PlayerAdded:Connect(function(p)
	p.CharacterAdded:Connect(function(char)
		local Humanoid = char:FindFirstChild("Humanoid")
		if Humanoid then
			Humanoid.JumpHeight = 0
			Humanoid.Sit = true
			Humanoid.Changed:Connect(function()
				if Humanoid.Sit == false then
					Humanoid.Sit = true
				end
			end)
		end
	end)
end)

The most appropriate solution for this case is to edit the humanoid state or Humanoid.JumpPower

1 Like

Drop a localscript in StarterGui, then write this

local PlayerService = game:GetService("Players")
PlayerService.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function(Character)
	Character.Humanoid.JumpPower = 0
	
	end)
	end)

Yeah Humanoid state is probably the best to disable, pushes away the other issue.

I think that everything is a bit good as set, Like the JumpPower is already set to 0, Theres a problem that might occur, You can’t leave the sitting state, If you have no JumpPower.

legit bro this is the easily thing to do in roblox so I’m expecting you to not know what client vs server is either…

Local Script Version:

game.Players.LocalPlayer.Character.Humanoid.JumpPower = 0 -- They can't jump... Yay

Script Version:

game.Players.PlayerAdded:Connect(function(plr) -- Everytime the player joins
	plr.CharacterAdded:Connect(function(char) -- Everytime their character is added (or they die)
		char.Humanoid.JumpPower = 0 -- They can't jump! Yay!
	end)
end)	

You were using a client-sided script, which means the server wouldn’t see it, And why would you use it in the StarterGui? Use it either on StarterCharacterScripts or ServerScriptService.

And sorry that I replied you by accident p-p

If jumping is disabled on the client it will never have an opportunity to be replicated to the server.

Basically, It just needs to use FireServer() Function if Its trying to use it in a client-sided script.

when they jump, the client tells the server they jumped and it replicates to all the other clients. If the client never sends that signal, the server will never replicate it to the other clients. The act of pressing your spacebar can only be detected on the client. There is no need for using a remote event

Then just use a server-side script, or a script in the StarterCharacterScripts. What I was saying is if the guy is trying to use it in a client-sided script then it would use a remote Event if he was trying to share it with the server.

If I’m getting a bit annoying about the sharing of the client that probably doens’t exists, I’m sorry.

dude all you have to do is set the local players jumppower to 0 and it will never replicate to the server if they jump. setting the jumppower on the client and server have the same effect so no remote event should be ever used

By the way, they just left and they aren’t responding anymore o_o

Probably just waiting a random guy give a solution lol.