Misterion
New Member
- Joined
- Jan 24, 2014
- Messages
- 52
- Reaction score
- 4
I was trying to add the effect of paralysis on the creature that step on item (id 2579), here is the script I am using and the error:
Script:
Error when the creature steps:
Script:
Lua:
function onStepIn(cid, item, pos)
if(item.itemid == 2579) then
if(not isPlayer(cid)) then
local condition = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 1000)
setConditionFormula(condition, -0.5, 0, -0.5, 0)
doAddCondition(cid, condition)
doTargetCombatHealth(0, cid, COMBAT_PHYSICALDAMAGE, -15, -30, CONST_ME_NONE)
doTransformItem(item.uid, item.itemid - 1)
end
else
if(isPlayer(cid)) then
doTargetCombatHealth(0, cid, COMBAT_PHYSICALDAMAGE, -50, -100, CONST_ME_NONE)
doTransformItem(item.uid, item.itemid + 1)
end
end
return true
end
function onStepOut(cid, item, pos)
doTransformItem(item.uid, item.itemid - 1)
return true
end
function onRemoveItem(item, tile, pos)
local thingPos = getThingPos(item.uid)
if(getDistanceBetween(thingPos, pos) > 0) then
doTransformItem(item.uid, item.itemid - 1)
doSendMagicEffect(thingPos, CONST_ME_POFF)
end
return true
end
Error when the creature steps:
Code:
[06/05/2018 15:58:23] [Error - MoveEvents Interface]
[06/05/2018 15:58:23] data/movements/scripts/trap.lua:onStepIn
[06/05/2018 15:58:23] Description:
[06/05/2018 15:58:23] (luaCreateConditionObject) This function can only be used while loading the script.
[06/05/2018 15:58:23] [Error - MoveEvents Interface]
[06/05/2018 15:58:23] data/movements/scripts/trap.lua:onStepIn
[06/05/2018 15:58:23] Description:
[06/05/2018 15:58:23] (luaSetConditionParam) This function can only be used while loading the script.
[06/05/2018 15:58:23] [Error - MoveEvents Interface]
[06/05/2018 15:58:23] data/movements/scripts/trap.lua:onStepIn
[06/05/2018 15:58:23] Description:
[06/05/2018 15:58:23] (luaSetConditionFormula) This function can only be used while loading the script.
[06/05/2018 15:58:23] [Error - MoveEvents Interface]
[06/05/2018 15:58:23] data/movements/scripts/trap.lua:onStepIn
[06/05/2018 15:58:23] Description:
[06/05/2018 15:58:23] (luaDoAddCondition) Condition not found