Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

How can I make a script find a player with the most knockouts/wipeouts in a leaderboard? [closed]

Asked by 10 years ago

I'm sorry if this is a big script to ask for, i've just been racking my brain over this for months and nothing ever seems to work. Is it even possible to do this?

0
Include code you have tried, this is not a request site User#11893 186 — 10y

Locked by evaera

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?

1 answer

Log in to vote
0
Answered by
Sublimus 992 Moderation Voter
10 years ago

To find most KO's:

topko = 0
person = "No one"
for _,v in pairs(game.Players:getChildren()) do
    if v:findFirstChild("leaderstats") then
        if v.leaderstats.knockouts.Value > topko then --You'll need to change 'knockouts' to whatever the name of the KO stat is
            topko = v.leaderstats.knockouts.Value --Change it here too
            person = v.Name
        end
    end
end
wait()
print(person.." had the most knockouts with "..topko.."!")

To find most WO's:

topwo = 0
person = "No one"
for _,v in pairs(game.Players:getChildren()) do
    if v:findFirstChild("leaderstats") then
        if v.leaderstats.wipeouts.Value > topwo then --You'll need to change 'wipeouts' to whatever the name of the KO stat is
            topwo = v.leaderstats.wipeouts.Value --Change it here too
            person = v.Name
        end
    end
end
wait()
print(person.." had the most wipeouts with "..topwo.."!")
Ad