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
Script Help Fatal Error : ERR : Unexpected token '{'
Clear Offline
Junior Member

Posts: 19
Threads: 4
Joined: May 2012
Reputation: 0
#1
Fatal Error : ERR : Unexpected token '{'

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
05-24-2012, 12:53 PM
Find


Messages In This Thread
Fatal Error : ERR : Unexpected token '{' - by Clear - 05-24-2012, 12:53 PM



Users browsing this thread: 1 Guest(s)