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

Can you check for models the same way you check for shirts/badges for a VIP script?

Asked by 9 years ago

I know it's possible to check if someone owns a shirt or badge in scripts, for say a VIP door or anything, but I'm wondering if this same method works with models? It seems if it knows if you own a shirt it will know if you own a model too. I don't need the exact code right now if it's complex, I'm just wondering if it is possible.

1 answer

Log in to vote
0
Answered by
yumtaste 476 Moderation Voter
9 years ago

I think you can. I got this answer from the Wiki page here.

I think you can use the PlayerOwnsAsset method of MarketPlaceService to determine whether a player owns a model or not. I'm not 100% sure of this, but I can't test it because I'm on a Chromebook. Please tell me if this script works.

local marketplaceService = game:GetService("MarketplaceService")
local modelId = 172047753 --change this to the ID of the model

script.Parent.Touched:connect(function(part)
local player = game.Players:GetPlayerFromCharacter(part.Parent)
if player then
print(marketplaceService:PlayerOwnsAsset(player, modelId))
end
end)
0
Thanks, I'll try that, as soon as I remember what I needed it for. Maxwell_Edison 105 — 9y
Ad

Answer this question