I'm still new with tables and for loops, I made this to try get the distance of every model in game.Workspace.NPCs but the table doesn't work right this is what it prints: Distance is 9.7385768890381 Distance is 58.984462738037 Distance is 67.759483337402 table: 1E10DC80 It prints the distances right but the table part just makes it print random letters and numbers each time, how do I fix this?
while wait(6) do
local distances = {}
for number,char in pairs (game.Workspace.NPCs:GetChildren()) do
local distance = (char.Head.Position - script.Parent.Head.Position).magnitude
distances[number] = distance
print("Distance is "..distance)
end
print(distances)
end
