I wanna make if you interact something you teleport i made that.
But now i want that you need a key for it..
So if you didn't use the key on it starts SetMessage and then a text like. I'ts locked i need a key to enter. and if you interact then you teleport to the cellar.
If you don't understand what i mean i show some pictures to make it clear.
Script in spoiler
Spoiler below!
HPS.
////////////////////////////
// Run first time starting map
void OnStart()
{
//---- COLLIDE CALLBACKS ----//
AddUseItemCallback("", "Cellar_Key", "CellarDoor1", "OpenCellarDoor1", true);
<CATEGORY Name="Messages">
<Entry Name="EnteringTheCellar">This seems like a storage, Maybe i can find something useful!</Entry>
</CATEGORY>
<CATEGORY Name="Inventory">
<Entry Name="ItemDesc_Cellar_Key">It's a Rusty Key, There is marked something on it, It is very rusty and hard to read[br]F*r Ent*r*ng Th*e C*ll*r.</Entry>
<Entry Name="ItemName_Cellar_Key">Rusty Key!</Entry>
</CATEGORY>
<CATEGORY Name="Journal">
<Entry Name="Note_DiaryJane_Name">Diary Jane 1/1</Entry>
<Entry Name="Note_DiaryJane_Text">My husband Jake is a miner.[br]He works in the mine here nearby already for 15 years.[br]Still im really scared that the mine is gonna colapsed,[br]The mine has been here for centuries![br]There is still a myth going around that there are some kind of monsters in there.[br]Me and Jake dont believe in myths,[br]But...What if they are really there.[br][br]Former.[br]Jane.</Entry>
</CATEGORY>
<CATEGORY Name="Levels">
</CATEGORY>
</LANGUAGE>
Pictures!
Inside the cellar where it should go when used key and interact the door.
The Cellar entrance at the back of the house.
Hope you can help me already thanks for helping!
Cheers
Create a script area around the door and make sure that it has ItemInteraction enabled. I named the area ScriptArea_1 in the script. You'll also need the change the entry name for the message.
(04-13-2013, 05:34 PM)NaxEla Wrote: Create a script area around the door and make sure that it has ItemInteraction enabled. I named the area ScriptArea_1 in the script. You'll also need the change the entry name for the message.
//////////////////////////// // Run when entering map void OnEnter() { AutoSave(); }
//////////////////////////// // Run when leaving map void OnLeave() {
}
Not working 100% like i want to but thx anyway.
Really nice that the text shown when i interact but.
When i use the key its open but the text is still getting shown.
And also if i interact it again i don't teleport to the cellar
That's strange :\ When I tested it, it worked perfectly
Here's the exact script I used to test it. I also made it so that the text will only show up the first time the player enters the cellar. You'll need to change the names teleport areas and .lang entries.
//////////////////////////// // Run first time starting map void OnStart() { SetLocalVarInt("CellarDoorOpen", 0); SetLocalVarInt("FirstTimeCellar", 1);
(04-13-2013, 10:44 PM)NaxEla Wrote: That's strange :\ When I tested it, it worked perfectly
Here's the exact script I used to test it. I also made it so that the text will only show up the first time the player enters the cellar. You'll need to change the names teleport areas and .lang entries.
//////////////////////////// // Run first time starting map void OnStart() { SetLocalVarInt("CellarDoorOpen", 0); SetLocalVarInt("FirstTimeCellar", 1);
//////////////////////////// // Run when entering map void OnEnter() { AutoSave(); }
//////////////////////////// // Run when leaving map void OnLeave() {
}
I have to add the script area at the door right or hatched whatever its called ;D
Well it works almost the only thing is i cant use the key on it.
Never mind working you just got + repp'd thanks allot