Jump to content

How can highest score for data or sql


ParadoxTR

Recommended Posts

You could do this

Make a table of player then

Take a global variable x

Then make function in which

Make a for loop for player In table and check

With getelement data which player score

Is great then assingn x to player

At the end of loop player with highest point would be stored in x

Link to comment

local tab ={}

local highest

function rank()

for i,v ipairs(getElementsByType("player")) do

tab=v;

end

highest = tab[1];

for i,v ipairs(tab) do

if(getElementData(tab,your data)> getElementData(highest,your data) then

highest = tab;

end

end

Player with highest score will be in variable highest

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...