Thanks for the reply. I took a look at the variable section of the manual, but it is confusing without a complete example. If you could help me figure this out at your convenience I'd really appreciate it. I'm about to make a really neat gameplay mechanic which is a pushable button panel that can open doors but also spawn enemies. The last bug in this mechanic is getting it to only work once or at least only spawn enemies once, when used.
So far, the way it works is I created a 3d model of a wall which is half the width of a standard EFPSE Cube, and put a raised "button" on it with red color. With my terminal script, I have it swap the model with a "pushed in button" version of this wall, with the button now green. The script will also unlock a door and also spawn 2 turret enemies behind the player at specific grid coordinates. I want it to be so that the terminal script will no longer open the door and spawn the turrets once it has already been activated. I tried to take your advice, and also read about variables in the manual.
So far I have this:
______________________________________________________________
MedBaySwitch1.script
map.SpawnedTurrets=0
if $SpawnedTurrets == 1 {
map return
}
entity delete 14 12 1
entity spawnat SwitchWall1OnNorth 14 12 1
sound PullLeverFast.wav Sounds/PullLeverFast.wav
play sound PullLeverFast.wav
entity spawnat PortableTurret 17 9 1
entity spawnat PortableTurret 13 9 1
$SpawnedTurrets=1
timeout .2
door unlock 14 17 2
door open 14 17 2 1
map quickreturn
____________________________________________________________
With the above script, the game does not crash, but the turrets still spawn when I use the terminal again