Hi, I want to print something to the console when the player is clicking on the item while being beaten up by monsters - that means the player will have that condition called INFIGHT. I did something like this, but it doesn't print anything
Lua:
function onUse(cid, item, fromPosition, target, toPosition, isHotkey)
local player = Player(cid)
if player:getCondition(CONDITION_INFIGHT) then
print("in FIGHT")
return player:sendCancelMessage("You may not teleport during or immediately after a fight!")
end
return true
end