Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do i change the jumpforce of someone when sitting?

Im making a game, and in the game you are not allowed to jump, but the issue is that whey the character sits, it cant stand up. I know i havr to change the jumpforce of the player sitting, but if i leave it like that the player will be able to jump (bad). So there must be a way that when the player stands up it jumpforce goes back to 0. I have no clue what to do.

2 answers

This will give you all the info you need to make this happen. I think the best way would to use a LocalScript in the player scripts that uses this event to see when a player sits up and sits down. When a player sits down revert their JumpPower to normal, when they sit up bring it back to 0. I believe you'll also have to use a RemoteEvent to set the player's JumpPower. Otherwise the script could be prone to exploiters and it's also good habit to make changes from the server side unless ofc it's a change in something like the GUI, because that's local.

Welp, i already solved it by myself, i just placed this code in a local script.

game.Players.LocalPlayer.Character.Humanoid.Seated:Connect(function()
	game.Players.LocalPlayer.Character.Humanoid.UseJumpPower = true
	game.Players.LocalPlayer.Character.Humanoid.JumpPower = 1
	while true do
		if game.Players.LocalPlayer.Character.Humanoid.Sit == false then
			game.Players.LocalPlayer.Character.Humanoid.JumpPower = 0
		end
		wait(1)
	end
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.