# This invocation calls a function that has effects that are not allowed by its context: suspends no\_rollback(3512)

**URL:** <https://forums.unrealengine.com/t/this-invocation-calls-a-function-that-has-effects-that-are-not-allowed-by-its-context-suspends-no-rollback-3512/1631309>\
**Category:** Verse\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, fortnite\
**Created:** [January 21, 2024, 10:54am UTC](https://forums.unrealengine.com/t/this-invocation-calls-a-function-that-has-effects-that-are-not-allowed-by-its-context-suspends-no-rollback-3512/1631309 "2024-01-21T10:54:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Galinha](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/galinha/32/881673_2.png) [@Galinha](https://forums.unrealengine.com/u/Galinha)\
**Post date:** [January 21, 2024, 10:54am UTC](https://forums.unrealengine.com/t/this-invocation-calls-a-function-that-has-effects-that-are-not-allowed-by-its-context-suspends-no-rollback-3512/1631309/1 "2024-01-21T10:54:22Z")

</div>

I’m having this error, can anyone guide me to find a solution?

```auto
TeleportCharacter(Character: fort_character) <suspends>: void :=
        AllPlayers := GetPlayspace().GetPlayers()
        if (AllPlayers.Length > 1): # Verifica se há mais de um jogador no playspace (você não quer teleportar apenas para si mesmo)
            RandomIndex: int = GetRandomInt(0, AllPlayers.Length - 1) # Escolhe um índice aleatório da lista
            if:
                RandomPlayer: player = AllPlayers[RandomIndex] # Obtém o jogador aleatório da lista
                RandomPlayer <> Character # Certifica-se de que o jogador aleatório não é o próprio personagem
                RandomFortCharacter: fort_character = RandomPlayer.GetFortCharacter[]
                TeleportToRandomPlayer(Character, RandomFortCharacter)

```

 ![Captura de Tela (27)](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/4/d/84d111877a8e483922acafdde09909f73dd531ad.png)
