10-10-2010, 01:17 AM
Here's the script... I tried to combine two scripts for a locked door and for another door that is supposed to shut, but it wouldn't let me load the level.
void OnStart()
{
AddEntityCollideCallback("Player" , "ScriptArea_1" , "CollideRoomTwo" , true, 1);
}
void CollideRoomTwo(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("cellar_wood01_1", true, true);
GiveSanityDamage(25, true);
}
{
AddUseItemCallback("", "awesomekey_2" , "lockedcellardoor1" , "UsedKeyOnDoor" , true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("lockedcellardoor1" , false, true);
PlaySoundAtEntity("", "unlock_door" , "lockedcellardoor1" , 0, false);
RemoveItem(awesomekey_2);
}
void OnEnter()
{
}
void OnLeave()
{
void OnStart()
{
AddEntityCollideCallback("Player" , "ScriptArea_1" , "CollideRoomTwo" , true, 1);
}
void CollideRoomTwo(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("cellar_wood01_1", true, true);
GiveSanityDamage(25, true);
}
{
AddUseItemCallback("", "awesomekey_2" , "lockedcellardoor1" , "UsedKeyOnDoor" , true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("lockedcellardoor1" , false, true);
PlaySoundAtEntity("", "unlock_door" , "lockedcellardoor1" , 0, false);
RemoveItem(awesomekey_2);
}
void OnEnter()
{
}
void OnLeave()
{