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