09-04-2011, 10:54 PM
I'm working on a custom story, and I've run into a problem.
I have a locked door that I want to open with a key, but when I go into the map, the game crashes and says there was an error in the script.
This is my script:
The map worked fine until I added the key commands into my script. Any help would be greatly appreciated.
I have a locked door that I want to open with a key, but when I go into the map, the game crashes and says there was an error in the script.
This is my script:
Quote:////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback("","Key_1", "mansion_3". "KeyOnDoor", true)
}
void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_3", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_3", 0, false);
RemoveItem("Key_1")
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
The map worked fine until I added the key commands into my script. Any help would be greatly appreciated.