[HELP] Native PlayEntityScriptedAnim usage?

Hi ! I’m working on a script for the Facility from GTA:Online.
It works kinda well for the most part like the elevator and Avenger support too.
I was looking through the code of the game to make the big doors outside to animate, everyting works fine like the audio and placing all entities to make it clean but I’m blocked now on how to use the native PlayEntityScriptedAnim to get those doors to open.
I tried everything that I could think but there’s also not that much documentation about this native and looking in the script of the game doesn’t help either, it’s just a mess.

If anyone knows how this native works, I’d love to be able to put it in use in game for the Facility !

Thanks a lot.

If there is an animation to open a door, you should be able to simply use TaskPlayAnim, or may look into PlayEntityAnim, both of which take an entity, animation dictionary, animation name, and then some extra parameters which vary between the natives.

I tired them before, but no chance and the code of the facility door in the base game use this exact native. It looks like this :

void func_4554(var uParam0, bool bParam1, float fParam2, float fParam3)//Position - 0x161A1D
{
	struct<21> Var0;
	struct<20> Var22;
	struct<20> Var44;
	
	if (!ENTITY::DOES_ENTITY_EXIST(*uParam0))
	{
		return;
	}
	if (!STREAMING::HAS_ANIM_DICT_LOADED("anim@amb@facility@hanger_doors"))
	{
	}
	if (ENTITY::IS_ENTITY_PLAYING_ANIM(*uParam0, "anim@amb@facility@hanger_doors", "open", 3) || ENTITY::IS_ENTITY_PLAYING_ANIM(*uParam0, "anim@amb@facility@hanger_doors", "close", 3))
	{
		func_4555(uParam0);
	}
	Var0.f_4 = 1065353216;
	Var0.f_5 = 1065353216;
	Var0.f_9 = 1065353216;
	Var0.f_10 = 1065353216;
	Var0.f_14 = 1065353216;
	Var0.f_15 = 1065353216;
	Var0.f_17 = 1040187392;
	Var0.f_18 = 1040187392;
	Var0.f_19 = -1;
	Var22.f_4 = 1065353216;
	Var22.f_5 = 1065353216;
	Var22.f_9 = 1065353216;
	Var22.f_10 = 1065353216;
	Var22.f_14 = 1065353216;
	Var22.f_15 = 1065353216;
	Var22.f_17 = 1040187392;
	Var22.f_18 = 1040187392;
	Var22.f_19 = -1;
	Var44.f_4 = 1065353216;
	Var44.f_5 = 1065353216;
	Var44.f_9 = 1065353216;
	Var44.f_10 = 1065353216;
	Var44.f_14 = 1065353216;
	Var44.f_15 = 1065353216;
	Var44.f_17 = 1040187392;
	Var44.f_18 = 1040187392;
	Var44.f_19 = -1;
	Var0.f_0 = 1;
	Var0.f_1 = "anim@amb@facility@hanger_doors";
	Var0.f_2 = "close";
	Var0.f_3 = fParam2;
	Var0.f_4 = fParam3;
	Var0.f_17 = 1000f;
	Var0.f_20 = 512;
	if (bParam1)
	{
		Var0.f_2 = "open";
	}
	TASK::PLAY_ENTITY_SCRIPTED_ANIM(*uParam0, &Var0, &Var22, &Var44, 0f, 0f);
}

What code have you tried yourself? It seems like the native takes an entity and then multiple tables as parameters

I don’t have the code anymore. When we tried it with my friend, it was with data view on the Diamond Casion Roulette because it needs this native too to animate the table correctly without clutter.
But it didn’t work at all and we abandonned the project since. I’m trying it to make it work again as of today on the Facility Doors but I don’t know where to start at all now

Have you tried copying what Rockstar has and simply converting it to Lua? You have the entire function already available.

Yes, it was one of our first attempt with my friend when we first tried it, didn’t work either