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

Problem with this jump boost game pass script?

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

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.

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 :)

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