The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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
Need help on a script ;) [solved!]
VeNoMzTeamHysterical Offline
Member

Posts: 240
Threads: 36
Joined: Dec 2012
Reputation: 3
#1
Question  Need help on a script ;) [solved!]

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);

}

void OpenCellarDoor1(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("CellarDoor1", false, true);
PlaySoundAtEntity("", "unlock_door", "CellarDoor1", 0, false);
RemoveItem("Cellar_Key");
}

void EnterCellar(string &in asEntity)
{
TeleportPlayer("InCellar");
SetMessage("Messages", "EnteringTheCellar", 5.0);
}

void LeaveCellar(string &in asEntity)
{
TeleportPlayer("OutCellar");
}
////////////////////////////
// Run when entering map
void OnEnter()
{

AutoSave();
}

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

}

LANG.

<LANGUAGE>
<RESOURCES>
</RESOURCES>
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">[br][br][br][br][br][br][br][br][br][br][br][br][br][br][br]</Entry>
</CATEGORY>

<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! Smile

Inside the cellar where it should go when used key and interact the door.

[Image: 10p5ybl.jpg]

The Cellar entrance at the back of the house.

[Image: 2052gr9.jpg]

Hope you can help me already thanks for helping!
Cheers Wink

http://www.frictionalgames.com/forum/thread-21719.html
Evil Awaking Work In Progress!
Hours Spend 472.
(This post was last modified: 04-13-2013, 11:44 PM by VeNoMzTeamHysterical.)
04-13-2013, 04:11 PM
Website Find


Messages In This Thread
Need help on a script ;) [solved!] - by VeNoMzTeamHysterical - 04-13-2013, 04:11 PM
RE: Need help on a script ;) - by Tiger - 04-13-2013, 04:23 PM
RE: Need help on a script ;) - by NaxEla - 04-13-2013, 05:34 PM



Users browsing this thread: 1 Guest(s)