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?
COMMUNITY QUESTION
Is it possible to make a system that checks a player for VIP shirt, but they don't have to wear it?
1 answer
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. :)
2 comments
0
Thx for tah credz. c;
0
:P
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
http://wiki.roblox.com/index.php?title=API:Class/MarketplaceService/PlayerOwnsAsset Believe it or not, it's that simple. :P
You could use a gamepass, but if you want to do this do what he said ^^^