I want to sue an for i,v in pairs loop on a dictionary but I want both of the values.
For example my dictionary is this:
local dictionary = {
GamerGod1000 = 100
}
and when I loop through it like this
for i,v in pairs(dictionary) do
end
I want to get the “GamerGod1000” and its value which is = 100. How do I do that?
I tried that and I am getting weird values. Maybe it has something to do with my script that actually sets the data of the module script. Here is it:
local event = game.ReplicatedStorage.RemoteEvent
local damageCollection = require(game.ReplicatedStorage.DamageCollection)
local player = rayCastResults.Instance.Parent
local plrName = player.Name
table.insert(damageCollection,player.Name)
if damageCollection.plrName == nil then
damageCollection.plrName = 0
end
damageCollection.plrName += 10