#How to disable Spam-Jumping
1 messages · Page 1 of 1 (latest)
wdym per click
he means he doesnt want players holding the Spacebar key to jump.
aka. spam-jumping
put a local script inside StarterPlayer > StarterChracterScripts
local UserInputService = game:GetService("UserInputService")
local Player = game.Players.LocalPlayer
Character = Player.Character or Player.CharacterAdded:Wait()
jump = (put base jump height here)
jumpOnCd = 0
Humanoid = Character:WaitForChild("Humanoid")
UserInputService.InputBegan:Connect(function(input, gameProcessed)
if input.KeyCode == Enum.Keycode.space then
Humanoid.JumpHeight = jump
task.wait(0.1)
Humanoid.JumpHeight = jumpOnCd
task.wait(PUT HOW LONG YOU WANT IT TO BE)
Humanoid.JumpHeight = jump
end
end
end)
i havent tested it but its probably a good starting point
This worked for a running script I made but I tweaked it so it would run jump height
** You are now Level 1! **
but thats just a cooldown, he wants 1 jump per spacebar press instead of jumping being held
Then make the jumpOnCd permanent and put a release KeyCode statement to reset the jump height
I have a statement like that but I don’t remember it rn
put a local script inside StarterPlayer > StarterChracterScripts
local UserInputService = game:GetService("UserInputService")
local Player = game.Players.LocalPlayer
Character = Player.Character or Player.CharacterAdded:Wait()
jump = (put base jump height here)
jumpOnCd = 0
Humanoid = Character:WaitForChild("Humanoid")
UserInputService.InputBegan:Connect(function(input, gameProcessed)
if input.KeyCode == Enum.Keycode.space then
Humanoid.JumpHeight = jump
task.wait(0.1)
Humanoid.JumpHeight = jumpOnCd
end
end
end)
UserInputService.InputEnded:Connect(function(input, gameProcessed)
If input.KeyCode == Enum.KeyCode.LeftShift then
Humanoid.JumpHeight = jump
End
End
That should work
I was thinking
Maybe we can reset it using another space bar? so it resets perfectly
It’s reset once you release the spacebar