When I manually change the value, it works but doesn't when changed in game??
Script is disabled at the start and enabled in another script when someone has pressed 'Vote' text button.
Changed to kikitobs answer - similar bug. It keeps saying every value is tied even though one value changes to 1 before script is enabled.
local Voted
local Tied = {}
for i,v in pairs(game:GetService("Lighting").Votes:GetChildren()) do
if Voted then
if v.Value > Voted.Votes then
Voted = {Votes = v.Value,Name=v.Name}
Tied = {}
elseif v.Value == Voted.Votes then
table.insert(Tied,v.Name)
end
else
Voted = {Votes = v.Value,Name=v.Name}
end
end
if #Tied > 0 then
script.Parent.Text = table.concat(Tied,", ").." are tying with "..Voted.Votes.. "votes."
else
script.Parent.Text = Voted.Name.." won with "..Voted.Votes.." votes."
end
script.Parent.Parent:Destroy()

3 comments
Shows same bug, but this time with 'Colour Rush' Instead of Obby - Moved votes to ReplicatedStorage instead of lighting.
I edited the script so that it supports ties now.
It keeps saying every value is tied even though one value changes to 1 before script is enabled.