Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Is it possible to make a system that checks a player for VIP shirt, but they don't have to wear it?

Asked by 7 years ago

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?

0
You could use a gamepass, but if you want to do this do what he said ^^^ turtle2004 167 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago
Edited 7 years ago

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. :)

0
Thx for tah credz. c; TheeDeathCaster 2368 — 7y
0
:P turtle2004 167 — 6y
Ad

Answer this question