Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Combination Lock Using Levers Code?
Athom Offline
Junior Member

Posts: 32
Threads: 6
Joined: Jul 2012
Reputation: 1
#7
RE: Combination Lock Using Levers Code?

I got a friend to help me with the script for it. Here it is for anyone who wants to use it!



void LeverPulled(string &in asEntity, int alState)
{
if(GetLocalVarInt("Sequence") == 0 && asEntity == "lever_2")
{
AddLocalVarInt("Sequence", 1);
SetLeverStuckState(asEntity, alState, true);
PlaySoundAtEntity("", "27_tunnel.snt", "Player", 0, false);
}
if(GetLocalVarInt("Sequence") == 1 && asEntity == "lever_1")
{
AddLocalVarInt("Sequence", 1);
SetLeverStuckState(asEntity, alState, true);
PlaySoundAtEntity("", "27_tunnel.snt", "Player", 0, false);
}
if(GetLocalVarInt("Sequence") == 2 && asEntity == "lever_3")
{
AddLocalVarInt("Sequence", 1);
SetLeverStuckState(asEntity, alState, true);
SetMoveObjectState("shelf_secret_door_1", 1);
PlaySoundAtEntity("", "scrape_wood_heavy.snt", "Player", 0, false);
PlaySoundAtEntity("", "27_tunnel.snt", "Player", 0, false);
StopSound("tunnel", 1.0f);
GiveSanityBoostsmall();
}

There you go. I think it is a bit simpler than the above script! ENJOY!
Small edit, fixing "tunnel" sound lasting for a LONG time!

(07-18-2012, 09:20 AM)Athom Wrote: I got a friend to help me with the script for it. Here it is for anyone who wants to use it!



void LeverPulled(string &in asEntity, int alState)
{
if(GetLocalVarInt("Sequence") == 0 && asEntity == "lever_2")
{
AddLocalVarInt("Sequence", 1);
SetLeverStuckState(asEntity, alState, true);
PlaySoundAtEntity("", "27_tunnel.snt", "Player", 0, false);
}
if(GetLocalVarInt("Sequence") == 1 && asEntity == "lever_1")
{
AddLocalVarInt("Sequence", 1);
SetLeverStuckState(asEntity, alState, true);
PlaySoundAtEntity("", "27_tunnel.snt", "Player", 0, false);
}
if(GetLocalVarInt("Sequence") == 2 && asEntity == "lever_3")
{
AddLocalVarInt("Sequence", 1);
SetLeverStuckState(asEntity, alState, true);
SetMoveObjectState("shelf_secret_door_1", 1);
PlaySoundAtEntity("", "scrape_wood_heavy.snt", "Player", 0, false);
PlaySoundAtEntity("", "27_tunnel.snt", "Player", 0, false);
StopSound("tunnel", 1.0f);
GiveSanityBoostsmall();
}

There you go. I think it is a bit simpler than the above script! ENJOY!
Small edit, fixing "tunnel" sound lasting for a LONG time!
I give thanks for writing this script to andyrockin123 and Obliviator27! I love you guys! You RULE!

Current Projects: The Cure 15%
4Shared Download: http://ow.ly/cqjk4
Youtube Video: http://ow.ly/cq2LR
(This post was last modified: 07-18-2012, 09:57 AM by Athom.)
07-18-2012, 09:20 AM
Find


Messages In This Thread
Combination Lock Using Levers Code? - by Athom - 07-16-2012, 10:36 AM
RE: Combination Lock Using Levers Code? - by Athom - 07-18-2012, 09:20 AM



Users browsing this thread: 3 Guest(s)