verse Bounty System help :c

Hi i have been trying to make a Bounty System. But as u see in the picture i keep getting this wrong. (if u say i have to line it up with the: ‘‘if’’ it gives more errors.

Hi @JustLuca,

Please post your code instead of a screenshot. This will make it easier for us to try and reproduce your error. I suspect something within your inner if might be causing an issue.

1 Like

using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }

using { /Fortnite.com/Devices }
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

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

Thank you so much bro. the code works but i cant YET test it (Dont have friends) But still thank you for fixing it

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.