Adny
Posting Freak
Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation:
173
|
RE: HELP!
2 main issues:
Lock Door isn't a valid string; you should never use spaces in the middle of a string name, just use underscores "_". I changed it to locked_door in the hps file; you should use that name in the level editor.
All callbacks (AddUseItemCallback, EntityCollideCallback, etc) go under void OnStart().
Here's a revision:
void OnStart()
{
AddEntityCollideCallback("Player", "explode_scare", "Explode", true, 1);
AddUseItemCallback("", "key", "locked_door", "KeyOnDoor", true); ///not Lock Door
}
void Explode(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("boom", 0);
}
void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("locked_door", false, true);
PlaySoundEntity("", "unlock_door", "locked_door", 0, false);
RemoveItem("key");
}
void OnEnter()
{
}
void OnLeave()
{
}
Hope that helped!
I rate it 3 memes.
(This post was last modified: 08-25-2012, 04:54 AM by Adny.)
|
|
08-25-2012, 04:53 AM |
|