Info about Testing Game Passes

Hi, First time posting, need some info on testing with game passes. When I run the game in a server with 1 player, i’m prompted with the game pass once I click on it in my shop. It then goes through, yet it still let’s me purchase the pass over and over. Is this normal through testing, or is there something wrong with my script. Also, I want to point out that when I click “play here” I have a print(“checked for game pass)” in one of the scripts to let me know if the player has the pass. It says I have the pass when I hit “play here”, and it no longer let’s me buy the pass.

This is normal. I experienced this issue before, and it turns out that the player owning the pass never updates mid game, so you have to use additional solutions to go around this.

The solution I used was CollectionService. Simply add a tag to the player that’s named after the gamepass they purchased, then when checking if the player owns a pass, check if they have the tag for it too.

I understand a little of what you are saying, I’ve only read some about Collection Service. Is there anyway you could provide an example to this? But I do appreciate you replying so quickly.

So let’s say you want to track whether or not a player has touched some special orb or pressed a button. A way to keep track is to add a StringValue to the player named stuff like “HasOrb” or “PressedButton”. CollectionService is like doing this, but better.

local collection = game:GetService("CollectionService")

collection:AddTag(player, "HasOrb") --this is like adding a stringvalue in a player named "HasOrb", except it isnt a viewable instance, just a mark you can access through scripts

if collection:HasTag(player, "HasOrb") then
    --this is checking if a player has a certain tag, in this case, "HasOrb", this is what you'd usually use collection service for
    print("yay! the player has an orb!")
end

collection:RemoveTag(player, "HasOrb") --this is like destroying a stringvalue in the player named "HasOrb", except it simply removes the mark the player has

There are more useful things you can do with CollectionService, take a look at the API reference for it.

1 Like

Well I added the tag in when the player bought the gamepass, and then later checked if the player owned it in a local script so the gui would be visible, but nothing happens. I have serverside and client side scripts running to check for the gui or if the player purchased the product.

so I have 2 different shops one for anyone that joins and one for when people purchase the game pass. Im trying to enable the gui for the people who own the gamepass to be visible.

Also, it never saves when I choose to run a server with one player, but it saves the info if I chose “play here” I’m confused and frustrated at this point. I’ve been making this gui for the last 10 days and nothing ever seems to go right. Also, I pretty new to scripting so that’s probably why.