| Can't for the problem with the unexpected token [SOLVED] 
 
				This is solved, thank you.I kind of just started scripting and map making yesterday, keep it clean and simple for a small newbie, thanks.
 
 
 
 Anyway, In my map, I want to create a small door slam scare. But I keep getting an error when testing the map, I think its just a mishap somewhere in the script. I also have a key, and a crowbar function in here, possibly interfering? I hope that isnt the case.
 
 
 
 The error ATM is saying: 40, 1: ERR: Unexpected Token {
 
 
 
 From that, it sounds like just some stupid mistake, but the help would be appreciated.
 
 
 
 Here is my hsp.:
 
 
 
 ///////////////////////////
 
 // Run when the map starts
 
 void OnStart()
 
 {
 
 AddUseItemCallback("", "crowbar", "crowbardoor", "UsedCrowbarOnDoor", true);
 
 AddEntityCollideCallback("crowbar_joint_1", "ScriptArea_1", "CollideAreaBreakDoor", true, 1);
 
 }
 
 
 
 
 
 void UsedCrowbarOnDoor(string &in asItem, string &in asEntity)
 
 {
 
 AddTimer("", 0.2, "TimerSwitchShovel");
 
 RemoveItem("crowbar");
 
 }
 
 
 
 void TimerSwitchShovel(string &in asTimer)
 
 {
 
 PlaySoundAtEntity("","puzzle_place_jar.snt", "", 0, false);
 
 SetEntityActive("crowbar_joint_1", true);
 
 }
 
 
 
 
 
 void CollideAreaBreakDoor(string &in asParent, string &in asChild, int alState)
 
 {
 
 AddPlayerSanity(25);
 
 PlayMusic("10_puzzle01.ogg", false, 0.7, 0.1, 10, false);
 
 SetSwingDoorLocked("crowbardoor", false, true);
 
 AddPropImpulse("crowbardoor", 0, 0, -50, "World");
 
 SetSwingDoorDisableAutoClose("crowbardoor", true);
 
 SetSwingDoorClosed("crowbardoor", false, false);
 
 SetMoveObjectState("crowbardoor", 1);
 
 PlaySoundAtEntity("","break_wood_metal", "AreaBreakEffect", 0, false);
 
 CreateParticleSystemAtEntity("", "ps_hit_wood", "AreaBreakEffect", false);
 
 SetEntityActive("crowbar_joint_1", false);
 
 SetLocalVarInt("Door", 1);
 
 }
 
 
 
 ///////////////////////////
 
 
 
 {
 
 SetEntityPlayerInteractCallback("slamdoor", "func_slam", true);
 
 }
 
 void func_slam(string &in asParent, string &in asChild, int alState)
 
 {
 
 SetPropHealth("slamdoor", 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);
 
 }
 
 
 
 ////////////////////////////
 
 // Run when entering map
 
 void OnEnter()
 
 
 
 {
 
 AddUseItemCallback("", "key1", "lockeddoor1", "unlock", true);
 
 }
 
 
 
 void unlock(string &in item, string &in door)
 
 
 
 {
 
 SetSwingDoorLocked(door, false, true);
 
 PlaySoundAtEntity("", "unlock_door", door, 0, false);
 
 RemoveItem(item);
 
 }
 
 
 
 ////////////////////////////
 
 // Run when leaving map
 
 void OnLeave()
 
 {
 
 
 
 }
 |