Hello, I’m currently stuck on a little issue I am facing with my voting system. I have got to the point where it would increment 3 int values based on what the players chose and selecting the highest but there is an issue I thought of! (it would increment 1 of the 3)
What if the 3 values equal each other? This is where I am stuck figuring out how I would do this
local sortedValues = {1,2,3} -- not the real values just an example
local highestValue = 0
for _,x in ipairs(sortedValues) do -- calculates highest value in the table
if x > highestValue then
highestValue = x
warn(highestValue)
end
end
Hints or Solutions of any kind would be appreciated!