Marketplace service returning as true

What is my problem? I am trying to make to see if the person owns the asset and then make it true but it keeps returning as true even though I do not own the ID mentioned.

local ASSET_ID = 3071710704
 
local MarketplaceService = game:GetService("MarketplaceService")
local PlayerOwnsAsset = MarketplaceService.PlayerOwnsAsset
local corporate = false
local flexi = false
local economy = false
local gui = script.Parent
local corporategreen = gui.Frame.greenlight1
local flexigreen = gui.Frame.greenlight2
local ecogreen = gui.Frame.greenlight3
local corporatered = gui.Frame.redlight1
local flexired = gui.Frame.redlight2
local corporategrey = gui.Frame.greylight1
local flexigrey = gui.Frame.greylight2
local ecogrey = gui.Frame.greylight3
 
local function corpclicked(player)
	local doesPlayerOwnAsset = ("PlayerOwnsAsset", MarketplaceService, player, ASSET_ID)
	if doesPlayerOwnAsset == true then
		corporate = true
		corporategrey.Visible = false
		corporategreen.Visible = true
	elseif doesPlayerOwnAsset == false then
		corporategrey.Visible = false
		corporatered.Visible = true
		wait(2)
		corporatered.Visible = false
		corporategrey.Visible = true
		wait(1)
	end
end

script.Parent.Frame.Corporate.MouseButton1Click:Connect(corpclicked)

Is this a shirt or a game pass, because I can not seem to find the asset.

Sorry, I put in the wrong ID, I’ve corrected it now.

Okay, can you provide a URL to the asset?

https://www.roblox.com/catalog/1369559700/Demon-SSJ-and-Extra-Move
Example t-shirt.

Oh okay, I was just confused when I looked at the T-Shirt.

Bump because I still need a solution.
cries

I recommend printing doesPlayerOwnAsset to see what it says, AND changing
if doesPlayerOwnAsset then
to
if doesPlayerOwnAsset == true then
because when pcall fails it will return a string for the second argument. You are likely getting a suppressed error.

1 Like

Now it just says I don’t own it with t-shirts that I do own.

Bump, still doesn’t work, keeps returning as false.

I still need help, no errors, it most likely has something to do with the ‘player’ argument, I added ‘elseif doesPlayerOwnAsset == false then’ and it doesn’t work so. I’d really appreciate some help.

Okay, figured it out, the script had to be placed in serverscriptservice and a remote event to be fired so that it could be checked, I was being stupid.