Hello guys, I just started using the editor 2 days ago and i've tried making a script that opens a door with a key. I have seen tutorials and i have been reading the wiki but it still wont work so I hope you guys can help me. I'm 16 BTW so don't blame me
My hps file is placed in my maps folder just so you know.
This is what the hps file looks like at the moment:
////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "bedroomkey_1", "mansion_1", "KeyOnDoor", true);
}
void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("bedroomkey_1");
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
Hope you can help me