OnuseItem ?

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
User avatar
Eleven Warrior
Posts: 752
Joined: Thu Apr 18, 2013 2:32 pm
Location: Australia

OnuseItem ?

Post by Eleven Warrior »

Hi I have created a item that when used should heal the champ of poison. I drink a poison potion use the item and the champ is not cured of poison.

{
class = "UsableItem",

onUseItem = function(self,champion)
playSound("curepoison_1")
champion:setCondition("poison", 0) ---Is this the problem---
hudPrint(champion:getName() .. " Uses the mugwort and poison is cured.")
end
},

}
}
User avatar
jxjxjf
Posts: 33
Joined: Fri Oct 24, 2014 6:26 am

Re: OnuseItem ?

Post by jxjxjf »

Should be

Code: Select all

champion:removeCondition("poison");
Everything else looks great. :D
User avatar
Eleven Warrior
Posts: 752
Joined: Thu Apr 18, 2013 2:32 pm
Location: Australia

Re: OnuseItem ?

Post by Eleven Warrior »

Ahhh thxs man :)
Post Reply