Alternatives to the function RefreshInterior()

Is there any way to avoid this flickering by updating only the door or something similar?

This is caused by (to change the state of the door): RefreshInterior(interiorid)

Is the door a rayfire object which you can trigger instead of refreshing the interior?

I honestly don’t know, the map resource is not mine, I’m just trying some ideas for the casino robbery script I’m doing. This is the mod: The Diamond Casino Heist & Arcade Interiors

You should be dealing with the door prop, not the whole interior.

That is the goal, but is there any native who does it?

Rockstar seems the call REMOVE_MODEL_HIDE on the orginal interior door, and then spawn two entities explosion_vault_01/02 and play the entity anim explosion_vault_01 and explosion_vault_02

decompiled script
	switch (iLocal_9592)
	{
		case 0:
			STREAMING::REQUEST_MODEL(iVar0);
			STREAMING::REQUEST_MODEL(iVar1);
			STREAMING::REQUEST_ANIM_DICT("anim_heist@hs3f@ig8_vault_explosive_react@left@male@");
			STREAMING::REQUEST_ANIM_DICT("anim_heist@hs3f@ig8_vault_explosive_react@right@male@");
			STREAMING::REQUEST_ANIM_DICT("anim_heist@hs3f@ig8_vault_door_explosion@");
			STREAMING::REQUEST_NAMED_PTFX_ASSET("cut_hs3f");
			if (!STREAMING::HAS_MODEL_LOADED(iVar0))
			{
				return;
			}
			if (!STREAMING::HAS_MODEL_LOADED(iVar1))
			{
				return;
			}
			if (!STREAMING::HAS_ANIM_DICT_LOADED("anim_heist@hs3f@ig8_vault_explosive_react@left@male@") || !STREAMING::HAS_ANIM_DICT_LOADED("anim_heist@hs3f@ig8_vault_explosive_react@right@male@"))
			{
				return;
			}
			if (!STREAMING::HAS_ANIM_DICT_LOADED("anim_heist@hs3f@ig8_vault_door_explosion@"))
			{
				return;
			}
			if (!STREAMING::HAS_NAMED_PTFX_ASSET_LOADED("cut_hs3f"))
			{
				return;
			}
			ENTITY::CREATE_MODEL_HIDE(vVar5, 25f, iVar2, 1);
			fLocal_9602 = 0f;
			fLocal_9603 = 0f;
			func_13527(1);
			break;
		
		case 1:
			if (ENTITY::DOES_ENTITY_EXIST(iLocal_9598))
			{
				func_13527(2);
			}
			else
			{
				iLocal_9598 = OBJECT::CREATE_OBJECT(iVar3, vVar6, false, false, true);
				func_13526(iLocal_9598, bVar9, 1, 1);
				iLocal_9599 = OBJECT::CREATE_OBJECT(iVar1, vVar7, false, false, true);
				func_13526(iLocal_9599, bVar9, 0, 0);
				ENTITY::SET_ENTITY_COMPLETELY_DISABLE_COLLISION(iLocal_9599, false, 0);
				ENTITY::SET_CAN_AUTO_VAULT_ON_ENTITY(iLocal_9599, 0);
				ENTITY::SET_CAN_CLIMB_ON_ENTITY(iLocal_9599, 0);
				ENTITY::SET_ENTITY_COORDS(iLocal_9599, vVar7, 1, false, 0, 1);
				ENTITY::SET_ENTITY_ROTATION(iLocal_9599, vVar8, 2, 1);
				iLocal_9600 = OBJECT::CREATE_OBJECT(iVar4, vVar6, false, false, true);
				func_13526(iLocal_9600, bVar9, 1, 1);
			}
			break;
		
		case 2:
			if (func_13525())
			{
				func_13527(4);
			}
			if (func_13524())
			{
				func_13523(vVar5, iVar0, iVar2);
			}
			break;
int func_13523(vector3 vParam0, int iParam1, int iParam2)
{
	if (!MISC::IS_BIT_SET(iLocal_9595, 0))
	{
		GRAPHICS::USE_PARTICLE_FX_ASSET("cut_hs3f");
		GRAPHICS::START_PARTICLE_FX_NON_LOOPED_AT_COORD("cut_hs3f_exp_vault", 2505f, -238.5f, -70.5f, 0f, 0f, 0f, 1065353216, 0, 0, 0);
		AUDIO::PLAY_SOUND_FROM_COORD(-1, "vault_door_explosion", vParam0, "dlc_ch_heist_finale_sounds", false, 0, 0);
		func_313(&uLocal_9596, 0, 0);
		MISC::SET_BIT(&iLocal_9595, 0);
	}
	if (ENTITY::IS_ENTITY_VISIBLE(iLocal_9598) && ENTITY::IS_ENTITY_VISIBLE(iLocal_9600))
	{
		if (!MISC::IS_BIT_SET(iLocal_9595, 2) && func_239(&uLocal_9596, 195, 0))
		{
			switch (MISC::GET_RANDOM_INT_IN_RANGE(0, 2))
			{
				case 0:
					TASK::TASK_PLAY_ANIM(iLocal_1073, "anim_heist@hs3f@ig8_vault_explosive_react@left@male@", "player_react_explosive", 8f, -8f, -1, 1048576, 0, 0, 0, 0);
					break;
				
				case 1:
					TASK::TASK_PLAY_ANIM(iLocal_1073, "anim_heist@hs3f@ig8_vault_explosive_react@right@male@", "player_react_explosive", 8f, -8f, -1, 1048576, 0, 0, 0, 0);
					break;
			}
			MISC::SET_BIT(&iLocal_9595, 2);
		}
		if (!MISC::IS_BIT_SET(iLocal_9595, 1) && func_239(&uLocal_9596, 0, 0))
		{
			ENTITY::SET_ENTITY_COMPLETELY_DISABLE_COLLISION(iLocal_9598, false, 0);
			ENTITY::SET_ENTITY_COMPLETELY_DISABLE_COLLISION(iLocal_9599, true, 0);
			iLocal_9601 = PED::CREATE_SYNCHRONIZED_SCENE(2488.348f, -267.364f, -71.646f, 0f, 0f, 0f, 2);
			ENTITY::PLAY_SYNCHRONIZED_ENTITY_ANIM(iLocal_9598, iLocal_9601, "explosion_vault_01", "anim_heist@hs3f@ig8_vault_door_explosion@", 1000f, 8f, 0, 1000f);
			ENTITY::PLAY_SYNCHRONIZED_ENTITY_ANIM(iLocal_9600, iLocal_9601, "explosion_vault_02", "anim_heist@hs3f@ig8_vault_door_explosion@", 1000f, 8f, 0, 1000f);
			PED::SET_SYNCHRONIZED_SCENE_PHASE(iLocal_9601, 0.056f);
			MISC::SET_BIT(&iLocal_9595, 1);
		}
		if (!MISC::IS_BIT_SET(iLocal_9595, 4) && func_239(&uLocal_9596, 220, 0))
		{
			ENTITY::REMOVE_MODEL_HIDE(vParam0, 25f, iParam2, false);
			MISC::SET_BIT(&iLocal_9595, 4);
		}
		if (!MISC::IS_BIT_SET(iLocal_9595, 5) && func_239(&uLocal_9596, 200, 0))
		{
			ENTITY::CREATE_MODEL_HIDE(vParam0, 25f, joaat("ch_prop_ch_explosive_01a"), 0);
			MISC::CLEAR_AREA_OF_PROJECTILES(vParam0, 25f, 0);
			MISC::SET_BIT(&iLocal_9595, 5);
			if (bLocal_1080)
			{
				func_11146(-1, 1, 0, 0, 0, -1);
			}
		}
		if (!MISC::IS_BIT_SET(iLocal_9595, 3) && func_239(&uLocal_9596, 315, 0))
		{
			PAD::SET_PAD_SHAKE(0, 130, 256);
			CAM::SHAKE_GAMEPLAY_CAM("LARGE_EXPLOSION_SHAKE", 0.5f);
			MISC::SET_BIT(&iLocal_9595, 3);
		}
		if ((((MISC::IS_BIT_SET(iLocal_9595, 0) && MISC::IS_BIT_SET(iLocal_9595, 1)) && MISC::IS_BIT_SET(iLocal_9595, 2)) && MISC::IS_BIT_SET(iLocal_9595, 3)) && MISC::IS_BIT_SET(iLocal_9595, 4))
		{
			func_13527(6);
			return 1;
		}
	}
	else
	{
		ENTITY::SET_ENTITY_VISIBLE(iLocal_9598, true, 0);
		ENTITY::SET_ENTITY_VISIBLE(iLocal_9600, true, 0);
	}
	return 0;
}

It has not been clear to me how to do it but thanks. Tomorrow I’ll try, see what I get.

do you know how to make it so if an explosion event on the entity occcurs it changes the entity set or interior the thing you did by switching but with C4

with the example of @TheIndra you should be able to do it

Will that code make it so if I c4 the closed vault door it switches to the broken vault door

Doing something like that code you should get it. Remember that you have to make it synchronize between all clients (at least the close ones)
Here are the natives, you need them: Native Reference - Cfx.re Docs

Is there like some explosion event i don’t know what native to use to change interior when an explosion happens on the vault door


have you tried looking at the web?
You can create explosions, camera movements, animations …
with an explosion effect that hides it you can change the model of a wall for example

yea i looked but im not really sure what to use if i want to make an interior refresh /change when i use C4/explosion on closed vault door