✓ Accepted answer
You don't index dictionary's with integers (whole numbers) instead you index them with the name you gave the index to be.
Example:
local diction = {
["Index"] = "Some Value";
["Something"] = "Another value"
}
for i, v in pairs(diction) do
print(i..v)
end
So you know the semi colon is the same as using a comma
Lets go back to the example you had. Your index is different then mine but here's how you index what you want from your dictionary.
local KillerStats = {
["Speed"] = 1,
["Damage"] = 3,
["Vision"] = 10
}
print(KillerStats.Speed)
print(KillerStats["Speed"])
Hope this helps!
1 comment
Wouldn't using a table be better for your use case as opposed to a dictionary?