I have a small script area and I have an "int bank" set to 0 and I want it to be 1 when the player is inside the area and go back to 0 when the player leaves.
void function(string &in asParent, string &in asChild, int alState)
{
if (bank == 0)
{ bank = 1; }
else if (bank == 1)
{ bank = 0; }
}
Not sure if you need to have the int name in "" if your referencing it like I have in the 'if' there, but basically when you enter the area the function runs, if it finds the int is 0 it sets it to one. Once the player leave the area the function will run again and if its at 1 it will be set back to 0. You probably dont want those collide callbacks to delete so put false where ive said 'delete?', but I dont know what your trying to do with this so, adapt as required.
void function(string &in asParent, string &in asChild, int alState)
{
if (GetLocalVarInt("bank") == 0)
{
SetLocalVarInt("bank", 1);
} else
SetLocalVarInt("bank ", 0);
}
So, you need to use SetLocalVarInt(name, val) every time you need to change the value of a variable? I was hoping it was enough like javascript that you could just set it by referencing the name and giving it a value. My apologies for poor practise OP!