So I made an inventory on my simulator, but I need an image to be displayed based on when a boolvalue is true for "filled" and the PetID equals a certain ID. I was going to make a table, but I was just testing the ID first to see if it would go to the direct frame that I needed. I don't know if this is how you use i,v in pairs correctly, but if someone could help me change the image based on the PetID and the boolvalue "filled" being true, I'd appreciate it. The following code is what I have so far
while wait(.1) do for i, v in pairs(script.Parent.Handler:GetChildren()) do if v:IsA("Frame") then if v.Filled == true then if v.SlotInfo.PetID.Value == 2 then v.Display.Image = "rbxgameasset://Images/1EarthGreenPet" end elseif v.Filled == false then v.Display.Image = "" end end end end