Jump to content

How to Damage zombies in LUA???


nolanri

Recommended Posts

local closeobjects = getPlayer():getCurrentSquare():getMovingObjects();
     
    for i=0, closeobjects:size()-1 do   

		if(closeobjects:get(i):isZombie()) then
		-- damage the (closeobjects:get(i)) zombie here
		end

	end

Ok have have been fooling with this for too long.  I want to damage and or knock down and or kill the zombies in this loop.  but the only thing I have found to work (though only on single player) is
closeobjects:get(i):removeFromWorld();

is to just remove the zombie and replace it with a corpse, but this has been very problematic and sometimes causes errors so Im back to the main question again

the question of how to Attack, or hit or knockdown or kill a zombies in this lua loop

 

please help

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...