Why doesnt this code work

why doesnt this double jump height gamepass work

-- local.gamepass = 44568126
game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		if game.MarketplaceService:UserOwnsGamePassAsync(player.UserId, gamepass) then
			character.Humanoid.JumpPower = 100
			
		end
	end)
end)

Hey! Try this.

local gamepass = 44568126;

game:GetService("Players").PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, gamepass) then
			character = character or player.Character or game:GetService("Workspace"):WaitForChild(player.Name);
			character.Humanoid.JumpPower = 100;
		end;
	end);
end);

it works thanks alot

Nice! Could you make my reply the solution to this thread?

1 Like

Remember that Code Review is for Already working code
If your code isn’t working and you need help with it you post it at Scripting support

Sure it’s not a big deal but it’s best to stay consistent.

1 Like