Hi i am making a zombie wave game and i decided to add a map voting system. I was trying to randomize the map that applies to each of the things you can vote for, I was able to randomize the name but i also made a value in the frame that the name applies to called map. This value is for the main script to call what map was most voted for but the value doesn't change in the map randomizer script.
local map = math.random(3)
if map == 1 then
script.Parent.Parent.Map.Value = 1
script.Parent.Parent.TextButton.Text = "Grasslands"
end
if map == 2 then
script.Parent.Parent.Map.Value = 2
script.Parent.Parent.TextButton.Text = "The Ditch"
end
if map == 3 then
script.Parent.Parent.Map.Value = 3
script.Parent.Parent.TextButton.Text = "Volcano"
end
this is the script and as you can see it chooses between 3 maps and puts the name of the map on the text button you click on to vote for the map, it also should change the map value(it is a number value) if it is chosen but it always stays at 0 help please.

2 comments
line 1, math.random(1,3)
This code is bad