its quite easy i went ahead and made some code for you and tested it so inside of the ai_soldier.lua paste this at the bottom it will track the number of kills
function ai_soldier_exit(e)
g_kills = g_kills + 1
CollisionOff(e)
end
if i did that correctly ... anyway then create a new lua file .
g_requiredkills = 15
g_kills = 0
function showkills_init(e)
end
function showkills_main(e)
Prompt("Kills: " .. g_kills)
if g_kills == g_requiredkills then
JumpToLevelIfUsed(e) -- jumps to whatever level you put in for the ifused properties panel
end
end
I had saved the lua file showkills.lua if you want a different name dont forget to change the showkills_init and main to whatever you name the file but this code will display the number of kills and if the number of kills = the requiredkills # then it jumps to the next level. attach this script to like a barrel make it always active so it will always run and goto the properties of the barrel and change the ifused field to whatever level you want it to change too. sometimes i have problems with it changing level still so one thing i found is if you change the UseKey to the name of the object (i usually rename it) it will then work. but keep the if used field the name of the next level without the .fpm. Hope this has helped.
oh if you are using zombies paste the first part in the ai_fastzombie.lua at the end or ai_zombiewalk.lua should have same results. oh but change where it says ai_soldier to match the script you are editing and again best practice is to make a copy of it renamed then edit.