Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why doesn't this script capture humanoid changes in online mode? [closed]

Asked by 9 years ago

I'm developing a game that involves conveyors, but everyone knows that you can simply bunnyhop across it. So I wrote a script that set the players' Jump value to false every time the humanoid changed. It works absolutely fine in offline mode, but in online mode it doesn't respond when the humanoid changes. Could any one help me? (By the way, FilteringEnabled is not on.)

wait(1)
local h=script.Parent.Parent.Character.Humanoid
function disable()
    h.Jump=false
end
script.Parent.Parent.Character.Humanoid.Changed:connect(disable)

Also, the script is in PlayerGui.

1 answer

Log in to vote
0
Answered by 9 years ago

Would this help?

wait(0.5)
local Human = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")
Human.Changed:connect(function()
    Human.Jump = false
end)

0
I'm printing the name of the humanoid, so I know that in fact it is there. This script does not work, unfortunately. ChipioIndustries 454 — 9y
0
You need to put the script into a LocalScript into StarterGui drslicendice 27 — 9y
0
I figured out what was wrong. The Humanoid doesn't change upon jumping. You have to use the KeyDown event, but even then the jumping event has already fired and there's nothing you can do. BodyVelocity's and BodyForces don't work either. ChipioIndustries 454 — 9y
0
Well, it worked 100% for me! drslicendice 27 — 9y
Ad

Answer this question