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.
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
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)
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.
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.
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