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
Script Help Multipul Keys
3gamers Offline
Junior Member

Posts: 10
Threads: 6
Joined: Oct 2013
Reputation: 0
#1
Multipul Keys

Hey again, I'm trying to get it so that a door only opens when all three keys are used but it keeps giving me a fatal error: unexpected end of script. I'm not sure if my script even works but it wont even load so I can test it. Please someone look over it Smile


void OnStart()
{
AddUseItemCallback("", "key1", "MD1", "Keyfunction1", true);
AddUseItemCallback("", "key2", "MD2", "Keyfunction2", true);
AddUseItemCallback("", "key3", "MD3", "Keyfunction3", true);
AddUseItemCallback("", "key4", "level_wood_3", "Keyfunction4", true);

SetLocalVarInt("Var1", 0);
SetEntityPlayerInteractCallback("dungeonkey1", "func1", true);
SetEntityPlayerInteractCallback("dungeonkey2", "func2", true);
SetEntityPlayerInteractCallback("dungeonkey3", "func3", true);

void OnEnter()
{

}

void OnLeave()
{

}
void Keyfunction1(string &in item, string &in door)
{
SetSwingDoorLocked("MD1", false, true);
PlayGuiSound("unlock_door.snt", 100);
RemoveItem("key1");
}

void Keyfunction2(string &in item, string &in door)
{
SetSwingDoorLocked("MD2", false, true);
PlayGuiSound("unlock_door.snt", 100);
RemoveItem("key2");
}

void Keyfunction3(string &in item, string &in door)
{
SetSwingDoorLocked("MD3", false, true);
PlayGuiSound("unlock_door.snt", 100);
RemoveItem("key3");
}

void Keyfunction4(string &in item, string &in door)
{
SetLevelDoorLocked("level_wood_3", false);
PlayGuiSound("unlock_door.snt", 100);
RemoveItem("key4");
}

void func1(string &in asEntity)
{
AddLocalVarInt("Var1", 1);
func4();

}

void func2(string &in asEntity)
{
AddLocalVarInt("Var1", 1);
func4();
}

void func3(string &in asEntity)
{
AddLocalVarInt("Var1", 1);
func4();
}

void func4()
{
if(GetLocalVarInt("Var1") == 3)
{
SetLevelDoorLocked("level_wood_2", false);
PlayGuiSound("unlock_door.snt", 100);
RemoveItem("dungeonkey1");
RemoveItem("dungeonkey2");
RemoveItem("dungeonkey3");
}
}

Nepenthe- WIP
10-29-2013, 05:33 PM
Find


Messages In This Thread
Multipul Keys - by 3gamers - 10-29-2013, 05:33 PM
RE: Multipul Keys - by i3670 - 10-29-2013, 05:45 PM
RE: Multipul Keys - by 3gamers - 10-29-2013, 05:51 PM
RE: Multipul Keys - by Omenapuu - 10-29-2013, 09:43 PM
RE: Multipul Keys - by 3gamers - 10-29-2013, 10:53 PM
RE: Multipul Keys - by Omenapuu - 10-29-2013, 11:10 PM
RE: Multipul Keys - by 3gamers - 10-29-2013, 11:27 PM



Users browsing this thread: 1 Guest(s)