Also:
The script line you're using should be used like this:
SetLevelDoorLocked("NameOfDoor", false);
You put false or true in there to make the door unlocked or locked.
So in your case:
void UseKeyOnDoor(string &in asItem, string &in asEntity)
{
SetLevelDoorLocked("Doorlvl1", false);
}
You already had the parameters right! That's great!
But if you only have what you just wrote (Which I'm going to assume since you didn't write anything else)
then you're gonna need a void OnStart()
In this void OnStart() you're gonna use (as Mudbill said) an AddUseItemCallback.
It looks like this:
AddUseItemCallback(string& asName, string& asItem, string& asEntity, string& asFunction, bool abAutoDestroy);
So with your setup it will look like this:
void OnStart()
{
AddUseItemCallback("", "Key1" "Doorlvl1", "UseKeyOnDoor", false);
}
Remember, if you already have a void OnStart(), don't just copy mine and paste it in your script. You cannot have 2 void OnStart()! THen just copy the script line, AddUseItemCallback, and put it in your void OnStart()
Trying is the first step to success.