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

Problem with this jump boost game pass script?

Asked by 3 years ago
Edited by JesseSong 3 years ago

Please encode Lua code in the Lua block code tag (look for the Lua icon in the editor).

I tried creating a jump boost gamepass, but the script I used for speed boost doesn't work with jump boost.

The Speed Boost script:

local Gamepass = 11070272
local Market = game:GetService('MarketplaceService')

game.Players.ChildAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(char)
        if Market:UserOwnsGamePassAsync(player.UserId,Gamepass) then
            local h = char:WaitForChild('Humanoid')
            h.WalkSpeed = 48
    end)
end)

The Jump Boost script:

local Gamepass = 14604213
local Market = game:GetService('MarketplaceService')

game.Players.ChildAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(char)
        if Market:UserOwnsGamePassAsync(player.UserId,Gamepass) then
            local h = char:WaitForChild('Humanoid')
            h.JumpPower = 10
    end)
end)

2 answers

Log in to vote
0
Answered by 3 years ago

As far as I understand from your code, there is no error in your script, the only problem is that your JumpPower value is very low, and this can result in a player practically without the ability to jump.

But if you're not convinced, you can try the following.

In ServerScriptService.

local MarkerPlaceService = game:GetService("MarketPlaceService")
local PassId = -- Gamepass id.
local JumpForce = 70

game.Players.PlayerAdded:Connect(function(Player)
local PlayerId = Player.UserId

Player.CharacterAdded:Connect(function(Character)
local HassPass = MarketPlaceService:UserOwnsGamePassAsync(PlayerId,PassId)
if HassPass then
    local Humanoid = Character:WaitForChild("Humanoid")
    if Humanoid then
        Humanoid.JumpPower = JumpForce
    end
end
end)

end)

Instead of an event that is triggered when the player's character is placed in the game, you can just use the following command.

Player.CharacterAdded:Wait()
-- This will make your code wait for the character add event

I hope I helped you, any questions, you can ask me. :)

Note: This code will run only once, at the beginning of the game, so if your speed is changed by another code, or if the character dies, the Script will not keep the changes, and the player will have his default speed again.

Ad
Log in to vote
-2
Answered by 3 years ago

Or you can use a gravity coil if that's good? You can even mess around with it and delete the sound of the gravity coil and also make the gravity coil invisible! If you would like to use this method here then here are the instructions: Add the actual gravity coil I recommend my one as its all setup and its invisible :) and there is no bounce sound either! Here is the link:

Instructions: https://www.roblox.com/library/6339536289/JUMP-GAMEPASS

1)Put your gamepass ID into line  of the "ServerScriptService" script
2)Put the "ServerScriptService" script into ServerScriptService
3)Put the "JumpCoil_put_in_serverstorage" into ServerStorage

THESE INSTRUCTIONS ARE ALSO IN A SCRIPT IN THE FOLDER Please accept my answer if it worked :)

Answer this question