Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Key and door problem
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#4
RE: Key and door problem

(01-01-2012, 04:46 AM)TheMadmaxster Wrote:
(01-01-2012, 04:42 AM)flamez3 Wrote:
(01-01-2012, 04:25 AM)TheMadmaxster Wrote: Alright, This is my .hps file
////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback("", "key_1", "door_1", "UsedKeyOnDoor", true);
}

void MyFunc(string &in asItemA, string &in asItemB)
{
SetSwingDoorLocked("door_1", false, true);
PlaySoundAtEntity("", "unlock_door", "door_1", 0, false);
RemoveItem(key_1);
}
////////////////////////////
// Run when leaving map
void OnLeave()
{

}

This is my .lang file (Ignore the note part)




Hope you enjoy!


Study Door Key
A key for the Study.


Dear Floreze
Dear Floreze,[br] You are truely crazy! I can't belive you. You Take our family rug then try to escape the house![br]Well, now you will pay! I've sent my servents to get you, the dead ones.[br]I may not finish this note, but if I find you I will-


Stop!
Stop!,[br] You can't go in that door, I see you right now! I'm locking the door.[br]I've hidden the key somewhere try finding it now![br]Muahahaha!


Everytime I try to pull up the map it says:
(12,14) ERR: 'key_1' is not declared. How do I fix?


So I need to change MyFunc to UsedKeyOnDoor?
Yes, and replace your remove item to this:

RemoveItem("key_1");

01-01-2012, 04:51 AM
Find


Messages In This Thread
Key and door problem - by TheMadmaxster - 01-01-2012, 04:25 AM
RE: Key and door problem - by flamez3 - 01-01-2012, 04:42 AM
RE: Key and door problem - by TheMadmaxster - 01-01-2012, 04:46 AM
RE: Key and door problem - by flamez3 - 01-01-2012, 04:51 AM
RE: Key and door problem - by TheMadmaxster - 01-01-2012, 04:57 AM
RE: Key and door problem - by flamez3 - 01-01-2012, 05:47 AM
RE: Key and door problem - by TheMadmaxster - 01-01-2012, 06:30 AM
RE: Key and door problem - by flamez3 - 01-01-2012, 08:32 AM
RE: Key and door problem - by TheMadmaxster - 01-01-2012, 06:35 PM



Users browsing this thread: 1 Guest(s)