How can I disable jumping from trip part

I have a simple trip part script and when the player touches the part it makes them trip. But I need it to make the player not stand up from the sitting position for 3 seconds. I have tried multiple things and nothing worked. I tried using JumpHeight and JumpPower but doesnt work.
Here is the script:

local trippart = script.Parent

trippart.Touched:Connect(function(part)
	if part.Parent:FindFirstChild("Humanoid")then
		part.Parent.Humanoid.Sit = true
	end
end)

You’ll probably want to set this up differently but this will stop a jump totally. Just by making it false the moment it turns true. You could redo the key and have a way to turn that off when needed but, this is pretty slick and cheap …

local humanoid = game.Players.LocalPlayer.Character:FindFirstChildOfClass("Humanoid")

humanoid:GetPropertyChangedSignal("Jump"):Connect(function()
	if humanoid.Jump then humanoid.Jump = false end
end)
1 Like

I can still jump up when I touched the trip part

That is a local script … try StarterGui or StarterCharacterScripts. This 100% works.

But I need the script to disable the palyer from jumping up when it touches the part. The player needs to be able to sit back up after 3 seconds

What do you mean literally by that?

So after they sit for 3 seconds do you need to stand them up?
This seems a bit hacky but it works for the most part. You’ll need to give it some love.
If you stand them up while still on the trippart things go a bit wonky. So I’ve added a few lines for that.

local player = game.Players.LocalPlayer
local trippart = workspace:WaitForChild("Part")

local function disableJump(humanoid)
	local conn
	conn = humanoid:GetPropertyChangedSignal("Jump"):Connect(function()
		if humanoid.Jump then humanoid.Jump = false end
	end) task.wait(3)
	if conn then conn:Disconnect() end
	
	trippart.CanTouch=false
	humanoid.Sit = false
	
	task.wait(2)
	trippart.CanTouch=true 
end

trippart.Touched:Connect(function(part)
	local humanoid = part.Parent:FindFirstChildOfClass("Humanoid")
	if humanoid and part.Parent == player.Character then
		humanoid.Sit = true
		disableJump(humanoid)
	end
end)

Sorry I am working on 3 here … yours does have a script. My bad.

1 Like

When I touch the part it does not make me sit down. The properties is that the transparency is 1 and cancolide is off. And the character is in R6

This is all done in a local script. The stopping the jump works. You’ll have to figure out the rest.
There is enough here to start working on this. This is definitely going to take some testing.
Maybe your touch part could be a seat. Then remove the weld to stand them up.

1 Like

You can disable jumping by disabling the jump humanoid state with Humanoid:SetStateEnabled:

local trippart = script.Parent

trippart.Touched:Connect(function(part)
	local humanoid = part.Parent:FindFirstChild("Humanoid")
	-- If there is a humanoid and it can jump
	if humanoid and humanoid:GetStateEnabled(Enum.HumanoidStateType.Jumping) then
		-- Make the humanoid sit and disable jumping
		part.Parent.Humanoid.Sit = true
		humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)

		-- Wait 3 seconds and re-enabled jumping
		task.wait(3)
		humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, true)
	end
end)

You can do some other cool stuff with SetStateEnabled like disabling walking/running, disabling climbing, etc.

1 Like

I still put it in a local script and it wont work

The trip part works now but I can still jump when I am sitting

Hmmm maybe also disable the getting up state?

local trippart = script.Parent

trippart.Touched:Connect(function(part)
	local humanoid = part.Parent:FindFirstChild("Humanoid")
	-- If there is a humanoid and it can jump
	if humanoid and humanoid:GetStateEnabled(Enum.HumanoidStateType.Jumping) then
		-- Make the humanoid sit and disable jumping
		part.Parent.Humanoid.Sit = true
		humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
		humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, false)

		-- Wait 3 seconds and re-enabled jumping
		task.wait(3)
		humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, true)
		humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, true)
	end
end)
1 Like

I can still jump when I am in the sitting position

This works inside a Script with its RunContext set to Client put inside a part:

local trippart = script.Parent

trippart.Touched:Connect(function(part)
	local humanoid = part.Parent:FindFirstChild("Humanoid")
	-- If there is a humanoid and it can jump
	if humanoid and humanoid:GetStateEnabled(Enum.HumanoidStateType.Jumping) then
		-- Make the humanoid sit and disable jumping
		part.Parent.Humanoid.Sit = true
		humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
		humanoid:SetStateEnabled(Enum.HumanoidStateType.Running, false)
		
		-- Wait 3 seconds and re-enabled jumping
		task.wait(3)
		humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, true)
		humanoid:SetStateEnabled(Enum.HumanoidStateType.Running, true)
	end
end)

(It turns out the one that needs to be disabled is “Running”.)

you can just set the jumpPower or jumpHeight to 0. (get it back to default value whenever you want to stand them up.)

1 Like

This doesn’t stop the character from being able to exit the Seated state.

I tried it just now while debugging the code above on both the client and the server and it didn’t work. Perhaps there is a way for it to work though.

No I tried that multiple times it just makes the characters jumpHeight to 0 and I can still stand back up


The trip part is in a slide

Huh okay. it worked for me 2 weeks ago