I have a note that when you finish reading, teleports you to a new map. This is a map that the player will have already been in before, therefore I need to tell the script that the player is revisiting the map for the second time, and to execute a certain script, otherwise it'd just execute the script from when they were in the map before. So, I have this code when the player reads the note:
void NoteRead(string &in asEntity, string &in asType)
{
AddGlobalVarInt("SwitchBack", 1);
}
Then on the map that they're teleported to:
void OnStart()
{
if(GetGlobalVarInt("SwitchBack") == 1)
{
[script for second visit]
}
else
{
[script for first visit]
}
}
But when the map is loaded and the player teleports, neither of the codes are executed.