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
#5
RE: Need help on a script ;)

(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.
PHP Code: (Select All)
////////////////////////////
// Run first time starting map
void OnStart()
{
    
SetLocalVarInt("CellarDoorOpen"0);
    
    
AddUseItemCallback("""Cellar_Key""ScriptArea_1""OpenCellarDoor1"true);
    
SetEntityPlayerInteractCallback("ScriptArea_1""EnterCellar"false);


void OpenCellarDoor1(string &in asItemstring &in asEntity)
{
    
AddLocalVarInt("CellarDoorOpen"1);
    
PlaySoundAtEntity("""unlock_door""CellarDoor1"0false);
    
RemoveItem("Cellar_Key");
}

void EnterCellar(string &in asEntity)
{
    if(
GetLocalVarInt("CellarDoorOpen") != 1) {
        
SetMessage("Messages""EntryName"0);
        return;
    }
    
    
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()
{


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 Wink

http://www.frictionalgames.com/forum/thread-21719.html
Evil Awaking Work In Progress!
Hours Spend 472.
04-13-2013, 05:44 PM
Website Find


Messages In This Thread
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
RE: Need help on a script ;) - by VeNoMzTeamHysterical - 04-13-2013, 05:44 PM



Users browsing this thread: 1 Guest(s)