use this instead:
-- if an entity is killed, raise killcount
script.on_event(defines.events.on_entity_died, function(event)
if string.find(event.entity.name,"spitter") or string.find(event.entity.name, "biter") or string.find(event.entity.name, "worm") or string.find(event.entity.name, "nest") or string.find(event.entity.name, "snapper") then
global.killcount = global.killcount + 1
end
end)