My gamepass GUI I made, which lets you get the Gamepass tool if you bought it, instead of the script that automatically gives you it, so your load out doesn’t have 10 tools, is currently not working. The problem is, I’ve tried it out in both game and studio and it’s giving me all of the tools, regardless if I have the gamepass or not. Does anyone know what the problem is?
If you want to take a look at it I’ve included both the script and gamepass UI. PleaseFix.rbxm (30.2 KB)
It’s a bit late for me so I skimmed through the scripts and couldnt find any issues other than the fact that you are using the ID of a decal to test it.
Are you certain this is how you intended to test your scripts?
Have in mind that when you switch your ID to the gamepass ID you’ll have to use the MarketplaceService’s dedicated method to verify that the player owns the pass
Indent your code, its really hard to read when someone doesnt use tab or spaces
Dont use a different script for each button, is much easier if you have a single LocalScript outside the UI (I usually use PlayerScripts) and loop through all the buttons that have the same functionality and connect them to a function. This way you reutilize code and you dont have to edit all your scripts each time you want to make a small change.
local GetInfo = MarketplaceService:GetProductInfo(1234567, Enum.InfoType.GamePass)
print(GetInfo.Name)
print(GetInfo.IconImageAssetId)
Also you would put this in the script that changes the image ID.
(Beware, getting GamePass image IDs from MarketplaceService has a high tendency not to function but I have noticed a difference in the API of all my gamepasses, especially in the ImageIconAssetId area, so this could be functioning properly now)
Which script do you want to update the image? I’ve not looked at the file because I’m on mobile. If you want efficiency I recommend handling all your GUI elements in one script called handler that is placed as a child in the ScreenGui to stop confusion with what scripts you need and for ease of access in the future.
Currently I have a local script inside each textbutton that gives you the tool, then I have a script in serverscriptservice for it to work, since my game is filtering enabled. I just need it the gui to where, if you bought a gamepass, then you click the button and it’ll give you the tool. So I don’t have to use the gamepass giver script that does it automatically.
Instead of having a local script in each text button, use one script that works exactly like the others but instead of script.Parent.MouseButton1Click just change it to script.Parent.TextButton1 etc. Using one script to manage everything will make your life 100% more easier especially if you plan on learning data store.
Alright so i think i know what your problem is it states in output that PlayerOwnsAsset is not a valid member of gamepassservice so that means you’re not using the correct thing try using this: