The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Doors unlocked after picking up the key?
Darkdevil725 Offline
Junior Member

Posts: 5
Threads: 2
Joined: Oct 2011
Reputation: 0
#1
Doors unlocked after picking up the key?

My doors were working just fine this morning but after adding some scripting now my doors unlock as soon as I pick up there respective keys rather than waiting till I use them. I check the scripting and nothing has changed. Thats the script, what is wrong?

void OnStart()
{
}

void OnEnter()
{
AddUseItemCallback("", "Study_Closet_Key", "Study_Closet", "KeyOnDoor", true);
AddUseItemCallback("", "hallway_key_1", "hallway_door_1", "KeyOnDoor", true);
AddEntityCollideCallback("Player", "hallway_door_slam_1", "func_slam", true, 1);
SetEntityPlayerInteractCallback("mansion_4", "func_slam", true);
}

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Study_Closet", false, true);
PlaySoundAtEntity("", "unlock_door", "Study_Closet", 0, false);
RemoveItem("Study_Closet_Key");
SetSwingDoorLocked("hallway_door_1", false, true);
PlaySoundAtEntity("", "unlock_door", "hallway_door_1", 0, false);
RemoveItem("hallway_key_1");
}

void func_slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("hallway_door_2", true, true);

PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);

PlaySoundAtEntity("", "react_scare", "Player", 0, false); PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);

GiveSanityDamage(5.0f, true);
}

void func_slam(string &in asEntity)
{
SetPropHealth("mansion_4", 0.0f);


PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);


PlaySoundAtEntity("", "react_scare", "Player", 0, false);


PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);


GiveSanityDamage(5.0f, true);
}


void OnLeave()
{
}
10-17-2011, 05:16 AM
Find


Messages In This Thread
Doors unlocked after picking up the key? - by Darkdevil725 - 10-17-2011, 05:16 AM



Users browsing this thread: 1 Guest(s)