Script not working

This script shows no errors but it’s not working at all

game.Players.PlayerAdded:Connect(function(Player)
if Player:GetRankInGroup(15554654) <2 then
Player.Character.Humanoid.Jump = true
game:GetService(“MarketplaceService”):PromptPurchase(game.Players.LocalPlayer, 10453709879)
end
end)

Can anyone see if something’s wrong with it or a solution?

is it a localscript or a server script?

if this is a script replace game.Players.LocalPlayer to Player.
you can’t get the LocalPlayer from a serverscript.
plus you already have the player as an argument in the PlayerAdded Event.

server script

game.Players.PlayerAdded:Connect(function(Player)
if Player:GetRankInGroup(15554654) <2 then
Player.Character.Humanoid.Jump = true
game:GetService(“MarketplaceService”):PromptPurchase(Player, 10453709879)
end
end)

still dont work

this was the script:

game.Players.PlayerAdded:Connect(function(Player)
if Player:GetRankInGroup(15554654) <2 then
Player.Character.Humanoid.Jump = true
game:GetService(“MarketplaceService”):PromptPurchase(game.Players, 10453709879)
end
end)

No. Not game.Players You’re taking the whole Service

here the PlayerAdded event gives an argument which is the Player Instance.

this should work fine.

nope doesnt work

its because the player’s character isn’t fully loaded yet

game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(char)
if Player:GetRankInGroup(15554654) < 2 then
char.Humanoid.Jump = true
game:GetService(“MarketplaceService”):PromptPurchase(Player, 10453709879)
end
end)
end)