I've found a flaw in the code I've used in my mod. Basically, I have a floor trigger in a fire pit that starts a timer when you land on it. This timer runs a script every second which damages the party by a certain amount until you get out of the pit, which sets off another floor trigger to stop the timer.
Code: Select all
function causedamage()
party.party:playScreenEffect("damage_screen")
playSound("champion_die")
for i=1,4 do
if party.party:getChampion(i):isAlive() then
party.party:getChampion(i):modifyBaseStat("health", -8)
else
end
end
end
But obviously, as ive found out, if you dont get out of the pit, it will keep repeating even though all the party is dead. I assumed the game would automatically end when all your party had died. How can I code it so that it ends the game when all the party is dead (game over screen) and turns off the timer etc.
Any help greatly appreciated
George