VerseIsland
FeedLearnLeaderboardGuidesReferenceExploreSearchDocsVerse Library
Sign in
Feed Learn 📖 Codex Leaderboard Guides Reference Explore Search Docs Verse Library
Browse Community Snippets›Devices·Up to Community Snippets · Devices·46 of 70 in Devices

Crown Device

Crown Device

Verse from mandeep/VerseMaxxing (Snippets/crown_device.verse), by mandeep, under the Apache-2.0 license. Pinned at commit 717ab803d. Compile-checked and ready to adapt for UEFN.

  • using { /Fortnite.com/Characters }
    using { /Fortnite.com/Devices }
    using { /Fortnite.com/Game }
    using { /Verse.org/Simulation }
    using { /UnrealEngine.com/Temporary/Diagnostics }
    
    
    crown_device := class(creative_device):
        var CrownTeam: crown_team = crown_team{}
        var SeekerTeam: seeker_team = seeker_team{}
    
        var CurrentCrownPlayer: ?agent = false
    
        Initialize(Crown: crown_team, Seekers: seeker_team):void=
            set CrownTeam = Crown
            set SeekerTeam = Seekers
    
        CrownPlayer(DamageResult: damage_result):void=
            if:
                Instigator := DamageResult.Instigator?
                InstigatorAgent := Instigator.GetInstigatorAgent[]
                Target := fort_character[DamageResult.Target]
                TargetAgent := Target.GetAgent[]
            then:
                spawn:
                    SwitchPlayerTeams(InstigatorAgent, TargetAgent)
    
        SwitchPlayerTeams(InstigatorAgent: agent, TargetAgent: agent)<suspends>:void=
            CrownTeam.InitializeAgent(InstigatorAgent)
            set CurrentCrownPlayer = option{InstigatorAgent}
            SeekerTeam.InitializeAgent(TargetAgent)
            if (TargetCharacter := TargetAgent.GetFortCharacter[], TargetCharacter.IsActive[]):
                TargetCharacter.SetVulnerability(false)
            # need to sleep so that the game doesn't end with an empty Seeker team
            Sleep(1.0)
            SeekerTeam.RemoveAgentFromTeam(InstigatorAgent)

You're reading a preview

The full reference is free for BrainDeadGuild Discord members — sign in to read it all, or open the original at the source.

Sign in with Discord — free for members Read the original at Epic Games documentation

Sign in with your BrainDead.TV / BrainDeadGuild Discord account for full access.

Guided course

Add this to your free study plan — we’ll suggest related material and stitch it into one compile-checked lesson.

Keep exploring
More in Devices · 46 of 70
Prev
fortnite dispose random props from array based on trigger event
Next
mandeep versemaxxing follower device

Source

Epic Games documentation

mandeep

Apache-2.0

View original
VerseIsland· an archipelago of Verse & UEFN knowledge
🗺️ Island atlasLearnGuidesHistoryAbout & PressSources & LicensingPrivacy PolicyTermsStatus

Not affiliated with Epic Games. Fortnite, UEFN, Unreal Engine, and Verse are trademarks of Epic Games, Inc. Content is attributed to its source — see Sources & Licensing.

🦜

Scout · your island guide

The Isle of Verse