-- goro7


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.Map1.Changed:connect(function()
	
	-- Update map name and image
	local newMap = voteStates.Map1.Value
	script.Parent.Image.Image = newMap.ImageAsset.Value
	script.Parent.MapName.Text = newMap.Name
	
end)

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