Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Double Jump Script isn't working when i test it?

I've got a double jump gamepass script that doesn't seem to be working can someone explain? heres the code: local passId = 4916610 --Change to you're Game Pass ID. game.Players.PlayerAdded:connect(function() function isAuthenticated(player) -- checks to see if the player owns your pass return game:GetService("GamePassService"):PlayerHasPass(player, passId) end

game.Players.PlayerAdded:connect(function(plr)
     if isAuthenticated(plr) then
repeat wait(0.001) until game.Players.LocalPlayer.Character.Humanoid
         game.Players.LocalPlayer.Character.Humanoid.JumpPower = game.Players.LocalPlayer.Character.Humanoid.Power + 30---Change this line to what you want the Game Pass to do.
     end
end)

end)

2 comments

0

Change game.Players.LocalPlayer.Character.Humanoid.Power + 30 into game.Players.LocalPlayer.Character.Humanoid.JumpPower + 30

0

and :connect is deprecated, :Connect.

1 answer

✓ Accepted answer

###Hello, TimeExotic.

###It is not working because LocalPlayer is nil on the server. You're also looking for a property called Power in the Humanoid, when no such property exists. Also, the PlayerHasPass method has been broken due to the new game pass update. You'll want to use the UserOwnsGamePassAsync method of the MarketplaceService.

local passId = 4916610
local MPS = game:GetService("MarketplaceService")

local function isAuthenticated(userId, gamePassId) -- define outside the PlayerAdded event
    return MPS:UserOwnsGamePassAsync(userId, gamePassId)
end

game:GetService("Players").PlayerAdded:Connect(function(plr) -- :connect is deprecated, use :Connect

    plr.CharacterAdded:Connect(function(char) -- wait for the character! 
        if isAuthenticated(plr.UserId, passId) then
            char.Humanoid.JumpPower = char.Humanoid.JumpPower + 30 
        end
    end)
end)

1 comment

0

Thank you so much! Cheers!

This discussion is preserved as it was. New answers, comments, and votes are closed.