local d=game.ServerStorage.States.MapVote d.CurrentlyVoting.Changed:connect(function()local M=d.CurrentlyVoting.Value script.Parent.Image.Visible=M script.Parent.CountLabel.Visible=M script.Parent.MapName.Visible=M script.Parent.Count.Visible=M end)d.Map2.Changed:connect(function()local M=d.Map2.Value script.Parent.Image.Image=M.ImageAsset.Value script.Parent.MapName.Text=M.Name end)d.Count2.Changed:connect(function()script.Parent.Count.Text=d.Count2.Value end)


local voteStates = game.ServerStorage.States.MapVote

voteStates.CurrentlyVoting.Changed:connect(function()
	
	-- Adjust visiblity
	local newVal = voteStates.CurrentlyVoting.Value
	script.Parent.Image.Visible = newVal
	script.Parent.CountLabel.Visible = newVal
	script.Parent.MapName.Visible = newVal
	script.Parent.Count.Visible = newVal
	
end)

voteStates.Map2.Changed:connect(function()
	
	-- Update map name and image
	local newMap = voteStates.Map2.Value
	script.Parent.Image.Image = newMap.ImageAsset.Value
	script.Parent.MapName.Text = newMap.Name
	
end)

voteStates.Count2.Changed:connect(function()
	
	-- Update map count
	script.Parent.Count.Text = voteStates.Count2.Value
	
end)
