Hello, I’ve been trying to make an inventory system over the last few days where image buttons become visible when the player has certain game passes. Unfortunately, I have no experience at all in scripting, so I’ve specialized more in modeling and design. I’ve tried it several times with an AI. Unfortunately, none of these scripts worked (the imagebuttons wount turn visible). Can anyone help me?
The imagebutton:
1 Like
You could use this code, adapting to what you already have:
-- Marketplace Service
local MarketplaceService = game:GetService("MarketplaceService")
GAMEPASS_ID = 859756827 -- The gamepass' ID
-- Get player instance
local player = game.Players.LocalPlayer
-- Reference the image button
local button = script.Parent.ImageButton -- Put your image button location
-- Check if player has gamepass
if MarketplaceService:UserOwnsGamePassAsync(player.UserId, GAMEPASS_ID) then
button.Visible = true -- Make button visisble
end
2 Likes
thank you very much for the script, could you perhaps explain to me which type of script (localScript, script ) I have to insert where so that this script works?
1 Like
That would be inside a localscript, since you’re dealing with a GUI and only affecting the client (player) that has the gamepass.
You can even put that inside the already existing script you have or make another one.

2 Likes
It wasn’t working, i send you a friend request when you excepted i can give you the processing right, and you can Help me ( only If you want )