This is sooo confusing! "Decides function"

Im sorry but this didnt really help. Ive moved past the original code tho by switching some stuff up but now im facing the same problem! Its always this gosh darn decides function when doing something random.

I wanna pick a random player at the start, sounds simple enough but im having immense trouble.

RandomPlayerClass : class_and_team_selector_device = class_and_team_selector_device{}



# Runs when the device is started in a running game
OnBegin<override>()<suspends> :void =
   if{ Decide[] } 

    
Decide()<decides>: void =
    AllPlayers := GetPlayspace().GetPlayers()
    Randomplayernumber := GetRandomInt(0, AllPlayers.Length-1)
    RandomPlayer := AllPlayers[Randomplayernumber]
    RandomPlayerClass.ChangeClass(RandomPlayer)    

Same Problem, the line where i call the decide function has following error “This invocation calls a function that has the ‘no_rollback’ effect, which is not allowed by its context.” meaning from what i know that it needs . But as soon as i add transacts this line:

RandomPlayerClass.ChangeClass(RandomPlayer)

Gets the same error “This invocation calls a function that has the ‘no_rollback’ effect, which is not allowed by its context.” I need both transacts and defines but I cant have transacts due to this line and if i dont have transacts i cant call the function. I dont know, i may just not get it but it seems contradicting to me, either way it confuses me and i neeed help.