I need the table Ores to be sorted but the first value is an object and i need it to be sorted by the Magnitude wich is the second value
for _, Ore in pairs(SpotObjects:GetChildren()) do
if Ore:IsA("BasePart") then
if Ore.Lvl1.Transparency == 0 then
OreMagnitude = (HumanoidRootPart.Position - Ore.Position).Magnitude
Ores[Ore] = OreMagnitude
end
end
end
table.sort(Ores)
for OresObject, i in pairs(Ores) do
print(OresObject, i)
end
When i do print its not printing it in order
