im trying to make a script that sorts a dictionaries values from smallest to greatest but whenever i print it it looks fine but if i put it into another dictionary it doesn’t look the same.
local dictionary = {
["Player6"] = 10,
["Player1"] = 69,
["Player4"] = 560,
["Player2"] = 50,
["Player5"] = 629,
["Player3"] = 45
}
local temptable = {}
local tempdictionary = {}
for i, v in dictionary do
table.insert(temptable,v)
end
table.sort(temptable)
for index, value in temptable do
for i, v in pairs(workspace.Map:FindFirstChildWhichIsA('Folder').playersInGame:GetChildren()) do
if dictionary[v.Name] then
if value == dictionary[v.Name] then
print(v.Name.." "..value)
tempdictionary[v.Name] = value
end
end
end
end
--dictionary = tempdictionary
--tempdictionary = {}
temptable = {}
print(tempdictionary)