How do I know if a player's number value is higher than others? It would be nice if someone could tell me how.
Pretty short, because I actually have no idea how to compare the values.
-- server script local highestPlayer = nil local function checkHighest() local highestValue = 0 for i,v in pairs (game.Players:GetPlayers()) do --game.Players:GetPlayers() returns a table. for i,v do loops goes through that table specified in the parentheses. i is the index of the table, v is the value or in this case the player if v.IntValue then --check if the intvalue exists in the player if v.IntValue.Value > highestValue then --check if the value of the int value is higher than the highest value highestValue = v.IntValue.Value --if it is, then set the highest value to the int value highestPlayer = v.Name --and the highest player to the player end end end end