I have tried this code and it is returning "nil" when I try to print out Chests[2]. Any help?
local Chests = {
DragonChest = {100,10000,100000,100000000};
}
function Open(Character, Player, Chest)
print(Character.Name, Player.Name, Chest[2])
--[[
local CameraChanger = script.CameraManip:Clone()
CameraChanger.Parent =
--]]
end
script.Parent.Touched:connect(function(Hit)
if Hit.Parent:FindFirstChild("Humanoid") and Hit.Parent:FindFirstChild("Head") then --check if cash is enough then subtract
local char = Hit.Parent
local plr = game.Players:GetPlayerFromCharacter(char)
Open(char, plr, Chests)
end
end)

3 comments
Yes
I think your issue is your essentially trying to print the name of the table, which might be your issue. Try indexing the actual Table.
What you have could be called a 2 dimensional table.