Call/Use a table with a name value?

So im making an inventory system… and im trying to come up with most efficient way to display/(know what) icon to display so i decided to use tables…

And here is the issue:

I don’t want to have to do an if statement for every item name like this:

local Apple = {
  Image = "Exampleid://19829832322222221"
= "Exampleid://19829832322222221"

if script.Parent.Name == apple then
 script.Parent.Image = Apple.Image

i would love to do something like

script.Parent.Image = script.Parent.Name--Make the button name call the table?.Image

I don’t recommend using the Name to know which image to show, you should instead use Attributes. With your example I would do something like this:

local Images = {
	["Apple"] = "rbxassetid://";
	["Orange"] = "rbxassetid://"
local ImageLabel = script.Parent

ImageLabel.Image = Images[ImageLabel.Name]