Jump to content

Kill Count Help


godssin

Recommended Posts

I am making a mod that requires each kill I make to change a global variable, does anyone know how a script to change variables on kill? I have looked and cant find a command for this anywhere.

Link to comment
Share on other sites

There must be another way than this but anyway

make a quest and atouch this script

 

scn AAAMySetEventHandlerKillQuestScript

short Myquestkillcount
ref attacker
ref target

begin gamemode

if getgameloaded
seteventhandler "OnDeath", MyKillCountFunction , "ref"::target, "object"::attacker

endif
message "Count-%0.f", Myquestkillcount;
end

 

this is an event handler on death - i think it monitors all deaths in game from what i see in the console

this is the functionscript

 

scn MyKillCountFunction
ref attacker
ref target

begin Function { target , attacker }

;do stuff

print $target + " was killed by " + $attacker
if attacker == player && target.iscreature == 0
set AAAKillCounterFQuest.Myquestkillcount to AAAKillCounterFQuest.Myquestkillcount + 1
endif

end

 

it sures conflict with unnessesery violence critical hits (in my game)-doesnt count a critical hit death i think because the kill is not comitted by the player

maybe some other mods

sometimes it doesnt count

test it perhaps it suits you

press ~ to open the console to see the messages

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...