Hello friends of Otland, I am starting to do scripts, I am currently making a war mine, I have two questions
The first: how can I make the item only activate on the floor?
The second: how can I make the damage when stepped on if the player has utamo vita lower his mana first. Here is a gift of how I have the script so far.
My Actions
My Movements
Thank you for your attention, I hope you can help me.
The first: how can I make the item only activate on the floor?
The second: how can I make the damage when stepped on if the player has utamo vita lower his mana first. Here is a gift of how I have the script so far.
My Actions
Lua:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if player:getItemCount(2346) >= 1 then
player:sendCancelMessage("no puedes usarlo.")
return false
end
if not player:getTile():hasFlag(TILESTATE_PROTECTIONZONE) then
if player:getLevel() >= 10 then
Game.createItem(6299, 1, item:getPosition())
item:remove(1)
return true
end
player:sendCancelMessage("You can't do it without be in a protection zones.")
return true
end
end
My Movements
Lua:
function onStepIn(creature, item, position, fromPosition)
if item:getId() == 6299 then
creature:addHealth(-150)
item:remove(1)
end
return true
end
Thank you for your attention, I hope you can help me.