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

Jump Setter Script Help?

Asked by
22To 70
9 years ago

Everytime i try this script it wont work...

function onPlayerEntered(newPlayer)
newPlayer.Character.Humanoid.Jump = 40
end
game.Players.ChildAdded:connect(onPlayerEntered)

function onPlayerRespawned(newPlayer)
h = newPlayer:findFirstChild("Humanoid")
if h ~= nil then
if game.Workspace:findFirstChild(h.Parent.Name) ~= nil then
h.Jump = 40 --Make sure this number is the same as the number above.
end
end
end
game.Workspace.ChildAdded:connect(onPlayerRespawned)

2 answers

Log in to vote
0
Answered by
Hero_ic 502 Moderation Voter
9 years ago

Sadly you can not just set the jump height or limit. You can on the other hand create your very own jump script that reduces jump height or increases it. You can also make the player unable to jump with that variable anymore. Then you would make your very own jump script which though a very great idea it would be quite complex.

I hope this gives you ideas!

Ad
Log in to vote
0
Answered by
ImageLabel 1541 Moderation Voter
9 years ago

Jump can be set to a certain numerical value. It is a boolean value, that can only be set to either true or false.

If your code is meant to make the user jump when they join the server and whenever they respawn, your code should look similar to this instead..

function OnPlayerAdded (newPlayer)
    if newPlayer:WaitForChild('Character').Humanoid then
        newPlayer.Character.Humanoid.Jump = true

        newPlayer.CharacterAdded:connect(function (character)
            character.Humanoid.Jump = true
        end)
    end
end

game.Players.PlayerAdded:connect( OnPlayerAdded )

I added a wait for the character before the first jump because if the script runs before the character is added, the player will not jump, because his character will not be found


If it's meant to set the height the player is able to jump, you would have to create your own jump system, because ROBLOX's default jump doesn't allow for setting "jump heights"

Answer this question