# How do I change class for all players using verse

**URL:** <https://forums.unrealengine.com/t/how-do-i-change-class-for-all-players-using-verse/1274383>\
**Category:** Verse\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, question, fortnite\
**Created:** [August 27, 2023, 3:41pm UTC](https://forums.unrealengine.com/t/how-do-i-change-class-for-all-players-using-verse/1274383 "2023-08-27T15:41:46Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![LyssaSugarNya](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/lyssasugarnya/32/722321_2.png) [@LyssaSugarNya](https://forums.unrealengine.com/u/LyssaSugarNya)\
**Post date:** [August 27, 2023, 3:41pm UTC](https://forums.unrealengine.com/t/how-do-i-change-class-for-all-players-using-verse/1274383/1 "2023-08-27T15:41:47Z")

</div>

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/f/1/7f121bdb129e07074ff4fc90b603ee9256cb8b6a.png)

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!

---

<div class="post-metadata">

**Author:** ![Twin01](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/twin01/32/1077777_2.png) [@Twin01](https://forums.unrealengine.com/u/Twin01)\
**Post date:** [August 27, 2023, 6:13pm UTC](https://forums.unrealengine.com/t/how-do-i-change-class-for-all-players-using-verse/1274383/2 "2023-08-27T18:13:07Z")

</div>

```auto
    grant_class(Agent:agent):void =
        AllPlayers := GetPlayspace().GetPlayers()
        for (Player : AllPlayers):
            class_granter.ChangeClass(Player)

```

---

<div class="post-metadata">

**Author:** ![DaviPires10](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DaviPires10](https://forums.unrealengine.com/u/DaviPires10)\
**Post date:** [August 27, 2023, 7:10pm UTC](https://forums.unrealengine.com/t/how-do-i-change-class-for-all-players-using-verse/1274383/3 "2023-08-27T19:10:28Z")

</div>

```auto

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  
😉👍

---

<div class="post-metadata">

**Author:** ![Twin01](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/twin01/32/1077777_2.png) [@Twin01](https://forums.unrealengine.com/u/Twin01)\
**Post date:** [August 27, 2023, 7:35pm UTC](https://forums.unrealengine.com/t/how-do-i-change-class-for-all-players-using-verse/1274383/4 "2023-08-27T19:35:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![LyssaSugarNya](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/lyssasugarnya/32/722321_2.png) [@LyssaSugarNya](https://forums.unrealengine.com/u/LyssaSugarNya)\
**Post date:** [August 27, 2023, 7:58pm UTC](https://forums.unrealengine.com/t/how-do-i-change-class-for-all-players-using-verse/1274383/5 "2023-08-27T19:58:49Z")

</div>

thank you very much I appreciate ur answer!

---

<div class="post-metadata">

**Author:** ![Twin01](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/twin01/32/1077777_2.png) [@Twin01](https://forums.unrealengine.com/u/Twin01)\
**Post date:** [August 27, 2023, 7:59pm UTC](https://forums.unrealengine.com/t/how-do-i-change-class-for-all-players-using-verse/1274383/6 "2023-08-27T19:59:06Z")

</div>

np! glad it helped 😀

---

<div class="post-metadata">

**Author:** ![LyssaSugarNya](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/lyssasugarnya/32/722321_2.png) [@LyssaSugarNya](https://forums.unrealengine.com/u/LyssaSugarNya)\
**Post date:** [August 27, 2023, 7:59pm UTC](https://forums.unrealengine.com/t/how-do-i-change-class-for-all-players-using-verse/1274383/7 "2023-08-27T19:59:43Z")

</div>

Thank you

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [September 26, 2023, 7:59pm UTC](https://forums.unrealengine.com/t/how-do-i-change-class-for-all-players-using-verse/1274383/8 "2023-09-26T19:59:59Z")

</div>

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