I checked trought this script like 250 times, never spotted any mistake. I have watched series of tutorials and searched on forums for solution. Didnot find any working ones, so i decided to make my own post. Also i'm perfectly sure that those names are right, just like i setted them in level editor.
////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "Superkey", "Superdoor", "UsedKeyOnDoor", true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity
{
SetSwingDoorLocked("Superdoor", false, true);
PlaySoundAtEntity("", "unlock_door", "Superdoor", 0.0f, false);
RemoveItem("Superkey");
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}