function round.ChooseMap ()
local choices = {}
for i = 1 , #maps do
if maps[i]:IsA("Model") then
table.insert(choices, maps[i])
end
end
local picked = choices[math.random(#maps)]
chosenmap.Value = picked.Name -- Error is on this line.
end
Been stuck on this for about 2 hours. Any help is apprecieated.
I meant index nill with name not value. but i dont have a value named Name. I have one named ChosenMap which is should be getting the values name but gives the index nil
for i, Maps in pairs(maps) do
if Maps:IsA("Model") then
table.insert(choices, Maps)
end
local picked = choices[math.random(1, #choices)]
Choosenmap.Value = tostring(Choices[picked])
end