why isnt the second chest opening?
local Chests = {game.Workspace.Chests.Chest1, game.Workspace.Chests.Chest2} local OpenChests = {game.ServerStorage.Chests.Game.OpenChest1, game.ServerStorage.Chests.Game.OpenChest1} Chests[1].KeyHole.ClickDetector.MouseClick:Connect(function() Chests[1]:Destroy() OpenChests[1]:Clone().Parent = game.Workspace table.remove(Chests, 1) table.remove(OpenChests, 1) print(Chests[1]) end)
local OpenChests = {game.ServerStorage.Chests.Game.OpenChest1, game.ServerStorage.Chests.Game.OpenChest1}
Chest2 is not within your OpenChest table
Chests[1].KeyHole.ClickDetector.MouseClick:Connect(function() Chests[1]:Destroy()
Furthermore, you are only listening for the keyhole of the first chest to be clicked, of which is automatically disconnected once it's opened since you destroy the object anyway.