#Humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false) not working

1 messages · Page 1 of 1 (latest)

wooden laurel
#

it literally just doesnt work

#

i test the game and i can still jump

runic plover
#

maybe set jump height to zero

wooden laurel
#

ill try that

small gobletBOT
#

studio** You are now Level 1! **studio

wooden laurel
#

im trying to add a jump cooldown

runic plover
#

oooh

wooden laurel
#

using jump property and jumping event hasnt helped me

#

i tried humanoid state changed* too

runic plover
#

then implement the cooldown

wooden laurel
#

wouldnt that have to be in a localscript

#

people could exploit that i think

runic plover
#

yea it would have to be local

#

is localscript exploitable

#

i forget

wooden laurel
#

im pretty sure it is

runic plover
#

oh ):

#

my entire game is based on it lmao

wooden laurel
#

i was told they can be edited and deleted

wooden laurel
#

i mean as long as its not multiplayer with competitive features im sure its fine

runic plover
#

yea

wooden laurel
#

but yeah exploiters can mess with them

#

they can also create their own local scripts

gloomy zinc
#

i think you can do it with server scripts

#

are you just trying to make a jump cooldown?

wooden laurel
#

but with what method

#

yeah

#

i tried to use statechanged

#

i tried propertychanged with humanoid.jump

#

i tried the jumping event

gloomy zinc
#

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)

small gobletBOT
#

studio** You are now Level 3! **studio

wooden laurel
#

ill try that

gloomy zinc
#

i tested it and it worked for me

wooden laurel
#

doesnt fully work

gloomy zinc
#

but you might need to increase the cooldown more than 0.2

wooden laurel
#

if i hold space

gloomy zinc
#

change to task.wait(1)

#

instead of 0.2

wooden laurel
#

my cooldown is 2...

#

i think it has to do with jump firing multiple times

gloomy zinc
#

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

wooden laurel
#

oh

#

hmm

#

ok ill try that

#

maybe its because mine is in serverscript

#

service

gloomy zinc
#

what are you doing to reference the humanoid from there

#

you should be able to

#

but that could be what was breaking it

wooden laurel
small gobletBOT
#

studio** You are now Level 2! **studio

gloomy zinc
#

that seems like it should work

#

weird i just changed mine to that and now its not working

wooden laurel
#

doesnt work even in the new script

#

well it works a bit

gloomy zinc
#

nvm im testing it again both ways and now its not working

#

its like working sometimes

wooden laurel
#

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

gloomy zinc
#

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)

wooden laurel
#

same issue

gloomy zinc
#

can i see your new code

#

cause its fixed for me now

wooden laurel
#

oh i wrote it wrong

#

sorry

gloomy zinc
#

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

wooden laurel
#

umm

#

i cant jump anymore i think

gloomy zinc
#

can i see the code again?

wooden laurel
gloomy zinc
#

try adding humanoid.JumpHeight=0, and humanoid.JumpHeight=7.2

#

because i think it uses jump height by default

wooden laurel
#

my game uses jumppower

gloomy zinc
#

ok then it should be fine then

wooden laurel
#

i only get one jump before jumping is disabled forever

gloomy zinc
#

ok let me look for a sec

#

are there any errors or anything?

#

this is the code im using

wooden laurel
#

no errors

#

ive written the same thing

#

but still the one jump problem

gloomy zinc
#

let me try in a new game rq

wooden laurel
#

oh wait

#

wait

#

i think i was just being impatient...

gloomy zinc
#

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

wooden laurel
#

theres a new problem though

fresh zephyr
#

does anyone know

gloomy zinc
#

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)

wooden laurel
#

oh ok nice

fresh zephyr
#

where to get

#

vouched for scripter?

gloomy zinc
#

idk

wooden laurel
#

thank you so much

gloomy zinc
#

did it work?

small gobletBOT
#

studio** You are now Level 4! **studio

wooden laurel
#

yeah

gloomy zinc
#

nice

#

you're welcome

wooden laurel
#

i guess ill move it into my other script

#

thank you

gloomy zinc
#

np

wooden laurel
small gobletBOT
#

studio** You are now Level 3! **studio

wooden laurel
#

that work at least

gloomy zinc
#

oh really?

#

maybe i could

#

i will think about it

wooden laurel
#

OHHH

gloomy zinc
#

idk if you actually need it still

wooden laurel
#

i think ur a genius

gloomy zinc
#

but it was to stop the function from running multiple times at once

wooden laurel
#

dont let anybody say otherwise

gloomy zinc
#

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

wooden laurel
#

oh that makes sense

winter nest
native dome
# wooden laurel it literally just doesnt work

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.

native dome
# wooden laurel people could exploit that i think

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.

sacred pier
wooden laurel
paper scarab
#

but stopping exploiters from having a 2 second cooldown on jumping is not the way

sacred pier
paper scarab
paper scarab
#

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

wooden laurel
#

im prolly gonna manually ban ppl myself

winter nest
wooden laurel
#

people who have the same issue will see it sooner now