Available since Version 1.27.
Checks if the given gag in a level has been completed.
Syntax
IsLevelGagCompleted( level, gag )Arguments
- level (integer): The level to check.
- Between 1 and 7 or the max
Levelsset by the Custom Stats Totals hack, if it is loaded.
- Between 1 and 7 or the max
- gag (integer): The gag to check.
- Between 1 and 32 (the max amount of gags in a level).
Return Values
- (boolean | nil): If the player has completed the gag or
nilif unavailable.
Examples
-- This is the 3rd persistent gag added to Level 1 in the base game
local FlandersBombShelterCompleted = IsLevelGagCompleted(1, 3)
if FlandersBombShelterCompleted then
-- Do something if Homer has compromised the integrity of Flanders' bomb shelter
endNotes
Gag indices correspond to the order persistent gags (those that call GagSetPersist to count towards the gag total) are added in the level's load script.