Hello, I have a problem, here is my script:
for i,v in pairs(playing) do for _,x in pairs(playing) do if v.Votes.Value == x.Votes.Value then if v.Votes.Value ~= 0 and x.Votes.Value ~= 0 then print("equal") tie = true end end end end
My problem is that when there are 3 players, one of them has 1 vote and others have 0 it still prints equal once and tie sets to true and I cant figure out why it does that... Any ideas?
Thank you.
See if this helps:
for i,v in pairs(playing) do for _,x in pairs(playing) do if v.Votes.Value == x.Votes.Value and v.Name ~= x.Name then if v.Votes.Value ~= 0 and x.Votes.Value ~= 0 then if v.Votes.Value ~= 0 and x.Votes.Value ~= 0 then tie = true end end end end
It kind of happened because v
and x
are the same thing (I think) and the script I have given will help.