"This invocation calls a function that has the 'no_rollback' effect, which is not allowed by its context."

Im having an issue trying to call GetTags() on a creative_object_interface. It gives me the error "This invocation calls a function that has the 'no_rollback' effect, which is not allowed by its context.", and Im not sure which part of the context that this is being used in is causing the error. Im using it in the following way:

    CheckSpawnerTag(PlayerSpawnerDevice: player_spawner_device, Tag: tag): void =
        if (PlayerSpawnerDevice.GetTags().Has[Tag]):
            Print("Has tag")

And the error occurs on the GetTags() call. Any idea what could be causing this?

2 Likes

Because .GetTags does not have <transacts>, it can’t be used inside of an if statement. You’ll need an if statement for the .Has[Tag], but you should be able to do

        Tags := PlayerSpawnerDevice.GetTags()
        if(Tags.Has[Tag]):
            Print("Has tag")
4 Likes