So I made a GUI voting system, and this GUI is placed into each player's PlayerGui and in each copy of this GUI is the local script which I will post below. For some reason only the first person's vote is counted.
So what happens is all the player get the GUI, and when the first person votes, it changes the value inside of the workspace, and adds a vote to it. Then for every other player that votes, nothing happens. The value isn't added. Not sure why.
The script is basically the same event 3 times in a row, for each vote button. The actual part that doesn't work is at the bottom.
local map1 = script.Parent.Map1
local map2 = script.Parent.Map2
local map3 = script.Parent.Map3
map1vote = map1.MouseButton1Click:connect(function()
if script.Parent.Vote.Value == "N/A" then
script.Parent.Vote.Value = map1.MapName.Text
map1.BorderColor3 = Color3.new(0, 170, 0)
elseif script.Parent.Vote.Value == map2.MapName.Text then
script.Parent.Vote.Value = map1.MapName.Text
map1.BorderColor3 = Color3.new(0, 0, 0)
map2.BorderColor3 = Color3.new(0, 0, 0)
map3.BorderColor3 = Color3.new(0, 0, 0)
map1.BorderColor3 = Color3.new(0, 170, 0)
elseif script.Parent.Vote.Value == map3.MapName.Text then
script.Parent.Vote.Value = map1.MapName.Text
map1.BorderColor3 = Color3.new(0, 0, 0)
map2.BorderColor3 = Color3.new(0, 0, 0)
map3.BorderColor3 = Color3.new(0, 0, 0)
map1.BorderColor3 = Color3.new(0, 170, 0)
end
end)
map2vote = map2.MouseButton1Click:connect(function()
if script.Parent.Vote.Value == "N/A" then
script.Parent.Vote.Value = map2.MapName.Text
map2.BorderColor3 = Color3.new(0, 170, 0)
elseif script.Parent.Vote.Value == map1.MapName.Text then
script.Parent.Vote.Value = map2.MapName.Text
map1.BorderColor3 = Color3.new(0, 0, 0)
map2.BorderColor3 = Color3.new(0, 0, 0)
map3.BorderColor3 = Color3.new(0, 0, 0)
map2.BorderColor3 = Color3.new(0, 170, 0)
elseif script.Parent.Vote.Value == map3.MapName.Text then
script.Parent.Vote.Value = map2.MapName.Text
map1.BorderColor3 = Color3.new(0, 0, 0)
map2.BorderColor3 = Color3.new(0, 0, 0)
map3.BorderColor3 = Color3.new(0, 0, 0)
map2.BorderColor3 = Color3.new(0, 170, 0)
end
end)
map3vote = map3.MouseButton1Click:connect(function()
if script.Parent.Vote.Value == "N/A" then
script.Parent.Vote.Value = map3.MapName.Text
map3.BorderColor3 = Color3.new(0, 170, 0)
elseif script.Parent.Vote.Value == map1.MapName.Text then
script.Parent.Vote.Value = map3.MapName.Text
map1.BorderColor3 = Color3.new(0, 0, 0)
map2.BorderColor3 = Color3.new(0, 0, 0)
map3.BorderColor3 = Color3.new(0, 0, 0)
map3.BorderColor3 = Color3.new(0, 170, 0)
elseif script.Parent.Vote.Value == map2.MapName.Text then
script.Parent.Vote.Value = map3.MapName.Text
map1.BorderColor3 = Color3.new(0, 0, 0)
map2.BorderColor3 = Color3.new(0, 0, 0)
map3.BorderColor3 = Color3.new(0, 0, 0)
map3.BorderColor3 = Color3.new(0, 170, 0)
end
end)
wait(9)
map1vote:Disconnect()
map2vote:Disconnect()
map3vote:Disconnect()
if script.Parent.Vote.Value == "N/A" then
print("It's N/A")
else
game.Workspace[script.Parent.Vote.Value].Value = game.Workspace[script.Parent.Vote.Value].Value + 1
end
print(game.Workspace[script.Parent.Vote.Value].Value)
wait(1)
script.Parent.Parent:Destroy()

1 comment
Just a moment while I type my reply.