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

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

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

✓ Accepted answer

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.

2 comments

0

How do I add the first argument as you said?

0

Player.UserId

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