Hey guys,
I have been working on a custom story and i wanted to add a door slam script, but when i added it to the .hps file it gave me an error saying Unexpected token "{" , I have no clue what to do in order to fix it, i'd appreciate any help.
////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "key1", "DoorName01", "UsedKeyOnDoor", true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("DoorName01", false, true);
PlaySoundAtEntity("", "unlock_door", "DoorName01", 0, false);
RemoveItem("key1");
}
{
AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);
}
void func_slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("DoorName01", 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);
}
Image of the Error:
http://gyazo.com/aba925b567f80c526ccc156c420efce7