Does this work?
I didn’t run it, but it doesn’t flag any warnings.
using { /Fortnite.com/Devices }
using { /Fortnite.com/Characters }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /Verse.org/Random }
bounty_board_device := class(creative_device):
@editable Bounty_Reference : player_reference_device = player_reference_device{}
@editable Bounty_Button : button_device = button_device{}
OnBegin<override>()<suspends>:void=
Bounty_Button.InteractedWithEvent.Subscribe(GetBounty)
GetBounty(Agent : agent):void=
AllPlayers := GetPlayspace().GetPlayers()
PlayersNum := AllPlayers.Length
#loops until it finds a random player index that is not the player who activated the bounty
loop:
RandomPlayerIndex := GetRandomInt (0, PlayersNum - 1)
if:
Inst_Player := player [Agent]
Bounty_Player := AllPlayers [RandomPlayerIndex]
Inst_Player <> Bounty_Player
then:
Print("Bounty Found")
if:
Bounty_FortChar := Bounty_Player.GetFortCharacter[]
Bounty_Agent := Bounty_FortChar.GetAgent[]
then:
Bounty_Reference.Register(Bounty_Agent)
break