#Humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false) not working
1 messages · Page 1 of 1 (latest)
maybe set jump height to zero
ill try that
** You are now Level 1! **
well the thing is
im trying to add a jump cooldown
oooh
using jump property and jumping event hasnt helped me
i tried humanoid state changed* too
you could make it so when the player presses space the jump height is set to zero after like 0.2 seconds
then implement the cooldown
im pretty sure it is
i was told they can be edited and deleted
😨
i mean as long as its not multiplayer with competitive features im sure its fine
yea
but yeah exploiters can mess with them
they can also create their own local scripts
i think you can do it with server scripts
are you just trying to make a jump cooldown?
but with what method
yeah
i tried to use statechanged
i tried propertychanged with humanoid.jump
i tried the jumping event
like this i think?
Humanoid:GetPropertyChangedSignal("Jump"):Connect(function()
if Humanoid.Jump == true then
Humanoid.JumpPower=0
Humanoid.JumpHeight=0
task.wait(0.2)
Humanoid.JumpPower=50
Humanoid.JumpHeight=7.2
end
end)
** You are now Level 3! **
ill try that
i tested it and it worked for me
doesnt fully work
but you might need to increase the cooldown more than 0.2
if i hold space
works for me
I put a server script in StarterCharacterScripts
and did this
local Humanoid=script.Parent:WaitForChild("Humanoid")
Humanoid:GetPropertyChangedSignal("Jump"):Connect(function()
if Humanoid.Jump == true then
Humanoid.JumpPower=0
Humanoid.JumpHeight=0
task.wait(2)
Humanoid.JumpPower=50
Humanoid.JumpHeight=7.2
end
end)
and it works when holding space for me
what are you doing to reference the humanoid from there
you should be able to
but that could be what was breaking it
** You are now Level 2! **
that seems like it should work
weird i just changed mine to that and now its not working
nvm im testing it again both ways and now its not working
its like working sometimes
yeah
i think its because jump is firing multiple times
so it goes from 0
back to a normal value
then 0 again
then back
ok i might have fixed it
do this
local index=0
Humanoid:GetPropertyChangedSignal("Jump"):Connect(function()
if Humanoid.Jump == true then
Humanoid.JumpPower=0
Humanoid.JumpHeight=0
index+=1
local n=index
task.wait(2)
if n~=index then return end
Humanoid.JumpPower=50
Humanoid.JumpHeight=7.2
end
end)
same issue
basically what was happening is there was overlapping of the function running multiple times at once
while it was waiting 2 seconds
so i stopped that from happening with the if statement after the task.wait
can i see the code again?
try adding humanoid.JumpHeight=0, and humanoid.JumpHeight=7.2
because i think it uses jump height by default
my game uses jumppower
ok then it should be fine then
i only get one jump before jumping is disabled forever
ok let me look for a sec
are there any errors or anything?
this is the code im using
let me try in a new game rq
wait no
it doesnt work if i dont hold space
something is still broken sorry 😭
ohhhh
wait
if Humanoid.JumpPower==0 or Humanoid.JumpHeight==0 then return end
theres a new problem though
does anyone know
local Players=game:GetService("Players")
Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(chr)
local index=0
local Humanoid=chr:WaitForChild("Humanoid")
Humanoid:GetPropertyChangedSignal("Jump"):Connect(function()
if Humanoid.JumpPower==0 or Humanoid.JumpHeight==0 then return end
if Humanoid.Jump == true then
Humanoid.JumpPower=0
Humanoid.JumpHeight=0
index+=1
local n=index
task.wait(2)
if n~=index then return end
Humanoid.JumpPower=50
Humanoid.JumpHeight=7.2
end
end)
end)
end)
oh ok nice
thank you so much
did it work?
** You are now Level 4! **
yeah
np
you should make a tutorial for it because theres no others
** You are now Level 3! **
that work at least
idk if you actually need it still
i think ur a genius
but it was to stop the function from running multiple times at once
dont let anybody say otherwise
yeah i think it works after removing it
i overcomplicated it 😭
all you needed was if Humanoid.JumpPower==0 or Humanoid.JumpHeight==0 then return end
oh that makes sense
it is
works totally fine game.Players:FindFirstChildOfClass("Player").Character:FindFirstChildOfClass("Humanoid"):SetStateEnabled(Enum.HumanoidStateType.Jumping,false) only this is you have to call this on the client, not the server.
it's fine. with or without your localscripts, exploiters can pretty much fly anywhere they want and teleport. even if you were to try to put this on the server somehow so "it cannot be exploited", exploiters can still fly and teleport, so you achieve nothing by caring about it this. roblox is simply designed that way.
so it's impossible to prevent exploits like flying and manipulating the player character?
oh so because I was doing that serverside it didn't work
no u can make anti cheats
but stopping exploiters from having a 2 second cooldown on jumping is not the way
People who lag
What
If ur saying it would falsely accuse people of cheating then just kick them and log it somewhere, instead of banning them for all eternity
im prolly gonna manually ban ppl myself
you have to put it in client btw
we have established that but thanks for saying it regardless
people who have the same issue will see it sooner now