I've adapted
AmenMoses' 'Kill X Enemies to Win' script so that it only applies to a single entity, which means it can be used to finish a level and jump to the next when you kill a specific game character, e.g. the level boss. You need to change the number '266' to whichever number the entity is, and in the 'ifused' section write the name of the next level to jump to. Could be useful for a few different types of games. This might be a really simple script for some, but it took me a while getting it to work through trial and error as I'm not a coder at all. I hope it's all ok for everyone who uses it.
local End_Game = true
local count = 0
function winboss_init(e)
end
function winboss_main(e)
local Soldier = g_Entity[266]
if Soldier ~= nil and Soldier.health > 0 then
End_Game = false
count = count + 1
end
if Soldier.health <= 0 then
JumpToLevelIfUsed(e)
else
end
end