2019-02-07 02:40:01 -08:00
|
|
|
# count each killed mob
|
|
|
|
|
|
|
|
if cmi ~= nil then
|
|
|
|
cmi.register_on_diemob(function(mob,cmi_death)
|
2019-02-07 07:00:51 -08:00
|
|
|
print("pong")
|
2019-02-07 07:46:48 -08:00
|
|
|
if mob ~= nil then
|
|
|
|
print(dump2(mob))
|
|
|
|
print(dump2(mob:get_player_name()))
|
|
|
|
end
|
2019-02-07 02:40:01 -08:00
|
|
|
if cmi_death == nil then
|
|
|
|
return
|
|
|
|
end
|
2019-02-07 07:00:51 -08:00
|
|
|
print(dump2(cmi_death))
|
2019-02-07 02:40:01 -08:00
|
|
|
if cmi_death.type == nil then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
if cmi_death.type ~= "punch" then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
if cmi_death.puncher == nil then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
local puncher=cmi_death.puncher
|
2019-02-07 20:26:29 -08:00
|
|
|
for key,value in pairs(cmi_death.puncher) do
|
2019-02-07 20:12:52 -08:00
|
|
|
print("found key "..key)
|
|
|
|
end
|
|
|
|
print(dump2(cmi_death.puncher:get_player_name()))
|
2019-02-07 07:08:23 -08:00
|
|
|
print(dump2(puncher))
|
2019-02-07 02:40:01 -08:00
|
|
|
local puncer_name=puncher:get_player_name()
|
2019-02-07 07:08:23 -08:00
|
|
|
print(dump2(puncher_name))
|
2019-02-07 07:46:48 -08:00
|
|
|
print(dump2(puncher:get_entity_name()))
|
2019-02-07 07:48:17 -08:00
|
|
|
print(dump2(puncher:get_luaentity()))
|
2019-02-07 02:40:01 -08:00
|
|
|
if puncher_name == nil then
|
|
|
|
return
|
|
|
|
else
|
|
|
|
xpfw.player_add_attribute(puncher,"killed_mobs",1)
|
|
|
|
end
|
|
|
|
end)
|
|
|
|
end
|