void OnStart()
{
AddEntityCollideCallback("Player", "AreaCollide", "EventCollide", true, 1);
AddUseItemCallback("", "Key3", "DOOR", "UseKeyOnDoor", true);
}
void EventCollide(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Grunt", true);
AddEnemyPatrolNode("Grunt", "Path_1", 0.001f, "");
AddEnemyPatrolNode("Grunt", "Path_2", 0.001f, "");
AddEnemyPatrolNode("Grunt", "Path_3", 0.001f, "");
AddEnemyPatrolNode("Grunt", "Path_4", 0.001f, "");
AddEnemyPatrolNode("Grunt", "Path_5", 0.001f, "");
AddEnemyPatrolNode("Grunt", "Path_6", 0.001f, "");
AddEnemyPatrolNode("Grunt", "Path_7", 0.001f, "");
AddEnemyPatrolNode("Grunt", "Path_8", 0.001f, "");
AddEnemyPatrolNode("Grunt", "Path_9", 0.001f, "");
AddEnemyPatrolNode("Grunt", "Path_10", 0.001f, "");
}
void UseKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "unlock_door.snt", asEntity, 0, false);
RemoveItem(asItem);
}
Fixed. The errors are because void OnStart() have no closing brace, void EventCollide have no opening brace, and AddUseItemCallback is not defined in a function.
Also, this is the wrong section.