Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why does it print the value but not it values name? [TABLES]

Asked by 3 years ago
Edited 3 years ago

Hello, I am trying to put values name and it's actual value into a table but it's not working as i had expected i print's only value but not the name of the value what am i doing wrong?

local MapVotes = {}
for i,v in pairs(game.ReplicatedStorage.Assets.Values.MapVotes:GetChildren()) do
        MapVotes[v.Name] = v.Value
    end

    print(MapVotes.Map1)
0
You already know what the key is since you are printing out the value of it? Nickuhhhhhhhhhhhhhhh 834 — 3y
0
well yeah but the script will need to find it itself i was here just testing. What i want to do right now is table.sort it and print the Map with biggest Value how would i do that? JustHentrix 4 — 3y
0
By table.sort i mean't table.sort the whole table so i know the highest value but i need to find the highest value's Name.. that's what i am stuck on JustHentrix 4 — 3y

Answer this question