Jump to content

Could you look at this code ?


justcrow

Recommended Posts

Hi, I want to make hammer decrease durability for carpentry like using weapon. so I found this code and want to ask if this code is right. Please give me hints.

 

local hammer = self.character:getPrimaryHandItem()
    if hammer and hammer:getType() == "Hammer" and ZombRand(hammer:getConditionLowerChance()) == 0 then
        hammer:setCondition(hammer:getCondition() - 1)
        ISWorldObjectContextMenu.checkWeapon(self.character);
    end

    self.item.character = self.character;
 self.item:create(self.x, self.y, self.z, self.north, self.spriteName);
 -- needed to remove from queue / start next.
    self.square:RecalcAllWithNeighbours(true);
 ISBaseTimedAction.perform(self);

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