How to affect all players in the map (Verse)

Hello, I just learned a bit of verse from the documentation and I just made a button which gives health to the player who presses it (I’ve attached screenshot of the code below). Now, my question is… how do I make the button give health to everyone on the island when the button is pressed?
I would appreciate any answers or suggestions because it would help me a lot. Thanks.

Hi, Assuming you don’t have reference to all your players somewhere else, that could be done by getting the players from the fort_playspace. Here’s a quick snippet showing how:

using { /Fortnite.com/Devices }
using { /Fortnite.com/Characters }
using { /UnrealEngine.com/Temporary/Diagnostics }


test_device := class(creative_device):

    HealAllPlayers(HealAmount: float):void=

        Playspace := GetPlayspace()
        
        for (Agent : Playspace.GetPlayers(), FortCharacter := Agent.GetFortCharacter[]):
            
            FortCharacter.Heal(HealAmount)

3 Likes

Thank you sm for taking the time to answer my question. It’s been a great help

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