[Pointshop] Hide items that you don't own?

Hey everyone,
I have the problem that want to hide specific items in the Pointshop for some reason that would take to long to explain.

There is this function:


function CATEGORY:CanPlayerSee(ply)
    return ply:HasItem('XYZ')
end

However, this is obviously only for categories, I tried searching the internet for a solution but I couldn’t find anything.

And no, this doesn’t work:


function ITEM:CanPlayerSee(ply)
    return ply:HasItem('XYZ')
end

Is there a way to solve this or is this a lost cause? ^^

Greeting, Santifocus

[editline]9th October 2017[/editline]

A different way to approach this would be changing the category if certain items (and than hide that other category)

maybe something in this direction:


function ITEM.SetCategory(ply)
    if ply:HasItem('XYZ') then
return "Owned"
else
return
"NotOwned"
end


Of course that wouldn’t work but maybe something that way?

[editline]9th October 2017[/editline]

Alrigth nvm.
Found a way to solve this on my own… xD


function categoryname(ply)
    if ply:HasItem('XYZ') then
return "Owned"
else
return
"NotOwned"
end
ITEM.Category = categoryname