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

Cash Gamepass Not Working (Doesn't Give Cash)?

Asked by 4 years ago
pcall(function()
    game.Players.PlayerAdded:connect(function(player)
        if game.MarketplaceService:UserOwnsGamePassAsync(player, 8511832) then
            repeat wait() until game.ServerStorage.PlayerMoney
            local cashmoney = game.ServerStorage.PlayerMoney:WaitForChild(player.Name)
            cashmoney.Value = cashmoney.Value + 999999999


        end
    end)
end)

I don't know why this isn't working. I've tested both 'UserOwnsGamepassAsync' and 'PlayerHasPass' but nothing happens.

1 answer

Log in to vote
1
Answered by
Ziffixture 6913 Moderation Voter Community Moderator
4 years ago
Edited 4 years ago

MarketplaceServiceā€™s method UserOwnsGamePassAsync requires the first argument to be the UserId of the Player it is verifying the asset to. This is required so it can find the account data.

You passed the Player Object, which is only used for game-related purposes.

0
How do I add the first argument as you said? Florian27 76 — 4y
0
Player.UserId Ziffixture 6913 — 4y
Ad

Answer this question