I currently have a door that scans the player who touches it for a VIP Shirt. They MUST wear it otherwise it won't allow access. I now want to make a GUI which allows them to click certain buttons if they own the shirt, but they don't have to wear it. How can one achieve this?
As TheeDeathCaster said, you would have to use PlayerOwnsAsset Which I believe can be carried out as follows:
local plr = game.Players.LocalPlayer local asset = 000000000 -- enter shirt's ID here local button = script.Parent --change script.Parent to path to GUI button button.MouseButton1Down:connect(function() if game:GetService("MarketplaceService"):PlayerOwnsAsset(plr,asset) then --Enter the code here which you want the button to do E.G --[[script.Parent.Text = "Player has Shirt!" wait(1) script.Parent.Text = "Click me!"]] else -- enter code here again, an example --[[script.Parent.Text = "Player does not have the Shirt!" wait(1) script.Parent.Text = "Click me!"]] end end)
Shortened down, it should look something like this:
local plr = game.Players.LocalPlayer local asset = 000000000 local button = script.Parent button.MouseButton1Down:connect(function() if game:GetService("MarketplaceService"):PlayerOwnsAsset(plr,asset) then --code here else -- enter code here end end)
However, In order for this certain script to work, it needs to be in a LocalScript inside the ScreenGui
If this doesn't work just comment and I will edit it. :)