Hello! so today out of curiosity i made a shop system but i want a feature which is the ‘lock’ effect. It is basically used in ninja legends where if you don’t have the next item [i will refer as item 1] the next item or item 2 doest is locked or has a silhouette effect.
i know i need to use a for loop but i have a custom numeric order. So i need to use in pairs. but should i exactly type?
I will assume that the items are displayed using ViewportFrames, in which you can change the ImageColor to complete black
ik that but how exactly should i apply to my code?
Whenever you need to update their inventory (because they bought something), you iterate over the entire shop catalog and apply silhouette to everything the player doesn’t own
--pseudocode
local white = Color3.new(1, 1, 1) --white should be the default image color
local black = Color3.new()
local function updateShop()
for _, v in ipairs(shopItems) do
v.Viewport.ImageColor3 = if v.Owned then white else black
end
end