so im trying to get the index from a module script and print the index and his value, but idk how,
i search and try some methods but all is just value not index and value
(and here is some of the methods that i try to use but only gets the index)
game.ReplicatedStorage.RollEmote.OnServerEvent:Connect(function(player)
local module = require(game.ServerScriptService.QuotesSlotsDS.EmoteList)
local function toArray(dictionary)
local result = {}
for index, v in pairs(dictionary) do
table.insert(result, index)
end
return result
end
local array = toArray(module)
local index = math.random(1, #array)
local chosen = array[index]
print(chosen)
end)
i try it but gives this error, but i think that is just getting the index on the table, what i want to know is how to get an index on a table with HIS value