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
#7
RE: Need help on a script ;) [not solved!]

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


void OpenCellarDoor1(string &in asItemstring &in asEntity)
{
    
SetLocalVarInt("CellarDoorOpen"1);
    
PlaySoundAtEntity("""unlock_door"asEntity0false);
    
RemoveItem(asItem);
}

void EnterCellar(string &in asEntity)
{
    if(
GetLocalVarInt("CellarDoorOpen") != 1) {
        
SetMessage("Messages""DoorLocked"0);
        return;
    }
    
    
TeleportPlayer("InsideCellar");
    
    if(
GetLocalVarInt("FirstTimeCellar") == 1) {
        
SetMessage("Messages""EnteringTheCellar"0);
        
SetLocalVarInt("FirstTimeCellar"0);
    }
}

void LeaveCellar(string &in asEntity)
{
    
TeleportPlayer("OutsideCellar");
}

////////////////////////////
// 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 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:23 PM by VeNoMzTeamHysterical.)
04-13-2013, 10:51 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 ;) [not solved!] - by VeNoMzTeamHysterical - 04-13-2013, 10:51 PM



Users browsing this thread: 2 Guest(s)