How do I change class for all players using verse

Hello, I know how to change a player’s class with class selector device using verse. But, how do i change class for all the players in my island?

For example, Instead of changing one player’s class, I want to change all player’s class!

1 Like
    grant_class(Agent:agent):void =
        AllPlayers := GetPlayspace().GetPlayers()
        for (Player : AllPlayers):
            class_granter.ChangeClass(Player)
2 Likes

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

hello_world_device := class(creative_device):
    
    @editable
    ClassChanger : class_and_team_selector_device = class_and_team_selector_device{}

    OnBegin<override>()<suspends>:void=
        ChangePlayersClass()

    ChangePlayersClass() : void = 
        AllPlayers := GetPlayspace().GetPlayers()
        for (Player : AllPlayers, Agent := agent[Player]):
            ClassChanger.ChangeClass(Agent)

You just need to get all the player in your island and change the class of each player, you could also setup a mechanic to change to a specific class
:wink::+1:

4 Likes

you don’t have to cast to agent in order to call the ChangeClass() function

thank you very much I appreciate ur answer!

1 Like

np! glad it helped :grinning:

Thank you

1 Like

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