for i, tools in pairs(MegaTable.Inventory) do
game.ReplicatedStorage[tools.Name]:Clone().Parent = Player.BPK
for i, toolstuff in pairs(tools) do
if toolstuff.Name == "Color" then
tools.Rarity.Color.Value = toolstuff
elseif toolstuff.Name == "MaxUpgrades" then
tools.Upgrades.MaxValue = toolstuff
else
tools[toolstuff.Name].Value = toolstuff
end
end
end
The problem is, the .Name property doesn't work with values, (ex. you cant have local wasd = wasdddd and then do wasd.Name to get wasd). So how would I get the variable name, and not the variable value in a script? If you know any way, or think something might work, please post an answer. Thanks.

9 comments
The dictionary reference (index) is stored in the parameter "i" within your enumeration loop.
but what about the name, as a string value and not the iteration?
Your question is confusing?
like, to not get the number of how many its gone through, but instead to get the name of it. Lets say I had a sword in my inventory, when I loop through, how would I get the name of the sword in the loop, if its just loading from a table?
In an enumeration loop, "i" doesn't refer to the iteration, it refers to the index. In a Dictionary, 'i" is the reference.
so how would I get the name from i, and not a number?
..........
like if its {toolexample = 65}, in the loop, how do I get the name "toolexample", and not 1 from the index?
if you're looping with pairs, i is "toolexample" and v is 65