while wait() do
local crate = game.ReplicatedStorage.TableCrates.RainbowCrate:GetChildren()
script.Parent.Image.Image = crate[script.Parent.Val.Value].Value
script.Parent.Image.TableName.Text = crate[script.Parent.Val.Value].Name
end
The erroring line is line 3.

2 comments
i dont understand what you mean, :GetChildren() actually gets a table with the children instances and not just a single child
there is an int value inside the script's Parent called 'Val.' So if Val is set to 1, it's trying to get the first child of crate.