What is wrong here? The script is so simple but it is not functioning...

As the title says I cannot figure out why this wont work…i took the snippet by Hafemi posted here https://dev.epicgames.com/community/snippets/ARpm/fortnite-teams-top-player-reference-updater and revised it to be for an ffa game but it is not working and it is driving me nuts! Help appriciated!

ffa_top_player_reference_updater := class(creative_device):

    @editable Tracker : tracker_device = tracker_device{}
    @editable Reference : player_reference_device = player_reference_device{}
    var MaybeTopPlayer : ?agent = false
    var TopPlayerWins: int = -1
    var CandidateWins: int = -1
    
    UpdateTopPlayerReference():void=
        Print("UpdateTopPlayerReference called..")
        Players := GetPlayspace().GetPlayers()
            for:
                Player : Players
            do:
                if (TopPlayer := GetTopPlayer[]):        
                    Validate(TopPlayer)                       
    
    Validate(Agent:?agent):void=
        Print("Validating TopPlayer...")
        if:  
            ValidAgent := Agent?
        then:
            Print("TopPlayer validated!")
            Reference.Register(ValidAgent)
                Print("Validated player is now the TopPlayer and is registered to reference device!")
        else:
            Print("Validation failed.")
    
    GetTopPlayer()<transacts><decides>:?agent=
        Print("Getting TopPlayer...")
            defer:
                set CandidateWins = 0
                Print("CandidateWins variable was reset")
            Players := GetPlayspace().GetPlayers()
                for (Player : Players): 
                    set CandidateWins = Tracker.GetValue(Player)
                        Print("CandidateWins: {Tracker.GetValue(Player)} set as the variable, and is now ready to compare to TopPlayerWins")
                    if: 
                        Print("Evaluating...")
                        TopPlayerWins < CandidateWins
                    then:                 
                        set MaybeTopPlayer = option{Player}
                        set TopPlayerWins = Tracker.GetValue(Player)
                        Print("Evaluation success, candidate has more wins than TopPlayer, passing player to validation...")
                    else:
                        Print("Evaluation failed, candidate has less wins then TopPlayer, validation not required.")
            return MaybeTopPlayer

Could you share what prints when you run this so we can see where it stops working?

I actually found the solution, the code was not being called because I did not have the <public> specifier and it was being called externally from another script. Once I added the specifier everything seemed to work, thanks for replying though! I should have posted the solution once I found it but I forgot