Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 2 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help getting a needle to unlock a door
Iyiyt Offline
Junior Member

Posts: 13
Threads: 5
Joined: Jul 2012
Reputation: 0
#9
RE: getting a needle to unlock a door

Actually, I'm having a problem with this. I set the door as "locked" in my level editor, and when I use the needle on it, it makes the noise but it stays locked. So I set the door as unlocked, and in my script, in OnEnter, I put "SetLevelDoorLocked(true);", so it would hopefully stay locked until I used the needle. But no, the door is just unlocked. What am I doing wrong? Here's my script:
void OnEnter()
{
ChangePlayerStateToNormal();
SetLanternDisabled(false);
SetEntityPlayerLookAtCallback("JimmyOne", "JimmyOne", true);
SetLevelDoorLocked("RoomDoor", true);
AddUseItemCallback("", "JimmyOne", "RoomDoor", "UnlockOne", true);
}

void JimmyOne(string &in asEntity, int alState)
{
SetMessage("Message", "JimmyMessageOne", 6.0f);
}

void UnlockOne(string &in asItem, string &in asEntity)
{
SetLevelDoorLocked("RoomDoor", false);
PlaySoundAtEntity("", "unlock_door", "RoomDoor", 0, false);
RemoveItem("JimmyOne");
}
(This post was last modified: 08-08-2012, 02:14 AM by Iyiyt.)
08-07-2012, 11:57 PM
Find


Messages In This Thread
RE: getting a needle to unlock a door - by Iyiyt - 08-07-2012, 11:57 PM



Users browsing this thread: 1 Guest(s)