Jump to content

setHealth issue


ProjectSky

Recommended Posts

i use the following code to modify zombie health, but i found some issue.

 

local zb = getPlayer:getCell():getZombieList()
if zb ~= nil then
  for i = 0, zb:size() - 1 do
    if zb:get(i):getHealth() < 2 then
      zb:get(i):setHealth(ZombRand(5.0, 10.0))
    end
  end
end
    

When I kill these zombies, the information panel shows that the number of kill zombies  keeps increasing.

 

730519592_GIF2020-05-2619-18-10.gif.74734a59fc278d010cab0dae9f4bb0b9.gif

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...