Frictional Games Forum (read-only)

Full Version: Closet script need help !!! :)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I am fully working on my custom story but now I am stuck in one of my script(Key to closet) and this is my script:



////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "KeyCloset", "ClosetLock", "UnlockCloset", true);
}

void UnlockCloset(string &in asItem, string &in asEntity)
{
SetEntityActive("ClosetLock", false);
GiveSanityBoost();
PlaySoundAtEntity("", "unlock_door", "Player", 0, false);
RemoveItem("KeyCloset");
}
////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}

This is my lang file:



<CATEGORY Name="Inventory">
<Entry Name="ItemDesc_KeyCloset">This is a hidden key for a closet in the basement </Entry>
<Entry Name="ItemName_KeyCloset">Double spare key</Entry>
</CATEGORY>

My key name is: Keycloset

And my blockbox is named: ClosetLock

Can you see what I am during wrong!! Smile

PLease help
My key name is: Keycloset


Your name of the key has a small c "c" and in your .hps and .lang file you are writting it with a capital c "C"
Can you please specify what you're trying to accomplish with your script? I'm not quite sure I follow what you're trying to do with a key and a block box. Also, why did you post your lang?
the lang I don't know, and all this. I made this because. When you pick up this secret key(not in the storyline, just free roam) you can open a closet to pick up a key that will lead to a huge secret area(libary) and there you will able to pick up alot of stuff Smile
(08-10-2012, 04:55 PM)andyrockin123 Wrote: [ -> ]Can you please specify what you're trying to accomplish with your script? I'm not quite sure I follow what you're trying to do with a key and a block box. Also, why did you post your lang?
There's a block box covering the front of the closet. when you use the key on the block box it rids of itself
Why not just lock it ._.
because you can't use the door function on it(if it is that you mention) Big Grin
You can use setswingdoorlocked on cabinets 0.o
I am 100% at least one of the cabinet types allows it (but I'm 90% the rest of them are compatible with the function as well).

The options under the entity tab of each cabinet is exactly the same as a swing door; I can confirm that mansion set cabinet does in fact work in game.
(08-10-2012, 08:35 PM)andyrockin123 Wrote: [ -> ]You can use setswingdoorlocked on cabinets 0.o
I am 100% at least one of the cabinet types allows it (but I'm 90% the rest of them are compatible with the function as well).

The options under the entity tab of each cabinet is exactly the same as a swing door; I can confirm that mansion set cabinet does in fact work in game.
you serious? ive been doing it a more complicated way this entire time. xD
Can you make me an script function?! to it Smile
Pages: 1 2