How to check if there is a tie between a few int values?

Hello, I am trying to make a game that players have to swim and the player with the most distance wins but if a player and another player got the same distance there shouldn’t be any winner, So how to check if there is a tie between a few int values (sorry if I had bad grammer)

There’s no easy way to do this.

The only way I can do this is set an array with all the intValues and then doing a for loop seeing if any are equal.

local results = {600, 405, 250}

for i,v in pairs(results) do
   if table.find(results,v) and table.find(results,v) ~= i then -- checks if it exists and if so then checks if it's not the same index so its not comparing with itself
      --do stuff
   end
end
1 Like