Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support


Post Reply 
 
Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can't get door to lock using SetSwingDoorLocked("mansion_1", false, true)
Author Message
Yonmaja Offline
Junior Member

Posts: 7
Joined: Oct 2010
Reputation: 0
Post: #1
Can't get door to lock using SetSwingDoorLocked("mansion_1", false, true)

I've tried everything to get this stupid door to lock and then open with a key, but I just can't.

Here's my exact script:
void OnStart()
{
AddUseItemCallback("", "awesomekey_1", "mansion_1", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("awesomekey_1");
}

I renamed the key awesomekey_1. I followed MulleDK19's video tutorial (http://hpl2.frictionalgames.com/tutorials) TO THE LETTER, and I still can't get the door to lock. What am I doing wrong?

I searched the forums and couldn't find a solution, even on the "Recollecting Scripts" thread the locking door post there didn't work. And yes, my door is named mansion_1.
10-21-2010 08:34 PM
Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
Can't get door to lock using SetSwingDoorLocked("mansion_1", false, true) - Yonmaja - 10-21-2010 08:34 PM



User(s) browsing this thread: 1 Guest(s)