Solved (Sorry I don't know how to explain this)

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Hackusater

Active Member
Aug 5, 2017
74
2
8
34
Hello, I have been having trouble with this for a very long time. It is kind of hard to explain what I am doing but you will understand if you look at the code:
code_language.skript:
on right click on player:
    add 1 to {example.%player%}
    
command /example <playername>:
    trigger:
        give 2 snowballs to (the player that has the most examples on %player%
Sorry that I am not explaining this well :/
 
code_language.skript:
set {_highest} to 0
loop {example::*}:
    if loop-value is greater than {_highest}:
        set {_topPlayer} to loop-index
        set {_highest} to loop-value
broadcast "%{_topPlayer}% - %{_highest}%"
this wont handle ties but you can add that yourself if you want it
 
code_language.skript:
set {_highest} to 0
loop {example::*}:
    if loop-value is greater than {_highest}:
        set {_topPlayer} to loop-index
        set {_highest} to loop-value
broadcast "%{_topPlayer}% - %{_highest}%"
this wont handle ties but you can add that yourself if you want it
Thanks! This is exactly what I needed!
 
Status
Not open for further replies.