Buttons that opens a door

Today I (xtron) will teach you (the reader) how to make lets say press 4 buttons and a door opens.

First off you will be needing THE DOOR!

THE DOOR:

Press on entities (7) > Doors > Choose the door of your liking and place it out on your map. Change the name of your door to door1.

Now if you want it be unlock itself when you pressed those magic buttons you will need to lock it!.

Click on the door you just created > Entity > Check the Lock box.

Now you're done with adding the door, lets add some buttons then!.

THE BUTTONS:

Press on entities (7) > Gameplay > Press on button_simple and place out how buttons you want the player to press and rename the buttons to your liking, for example: button1, button2 , button3 etc…

Now you're done with adding the buttons, we can finally go to the scripting part! yeeey!.

THE SCRIPT:

Lets say that you want the player to press 4buttons and then a door unlocks itself and opens a bit.

Add this to your void OnStart()

SetLocalVarInt("Var1", 0);
SetEntityPlayerInteractCallback("button1", "func1", true);
SetEntityPlayerInteractCallback("button2", "func2", true);
SetEntityPlayerInteractCallback("button3", "func3", true);
SetEntityPlayerInteractCallback("button4", "func4", true);

When you're done adding that you can start adding the functions which looks like this:

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