Memerto
PHP, JS, LUA, HTML...
- Joined
- Oct 18, 2009
- Messages
- 131
- Solutions
- 6
- Reaction score
- 25
Hi community!
I had a problem with a lua code and I don't know where is the mistake.. Here it is, I'll explain the trouble below:
Movement script called weapons.lua
I wrote this in movements.xml
I was trying to make equip items to raise skills using movements instead of items.xml keys and I thought it'd be easy , but I failed. It's supossed to be a sword that increase your sword skill by 28, but it has no effect when I equip it. No errors in console. I'm using tfs 0.3.6 pl1.
So here I am, asking you, wise community: where's the error?
I had a problem with a lua code and I don't know where is the mistake.. Here it is, I'll explain the trouble below:
Movement script called weapons.lua
Code:
condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, -1)
setConditionParam(condition, CONDITION_PARAM_SUBID, 1)
setConditionParam(condition, CONDITION_PARAM_SKILL_SWORD, 28)
function onEquip(cid, item, slot)
doAddCondition(cid, condition)
return true
end
function onDeEquip(cid, item, slot)
doRemoveCondition(cid, CONDITION_ATTRIBUTES, 1)
return true
end
I wrote this in movements.xml
Code:
<movevent event="Equip" itemid="7382" function="onEquipItem" slot="hands" script="weapons.lua"/>
<movevent event="DeEquip" itemid="7382" function="onDeEquipItem" slot="hands" script="weapons.lua"/>
I was trying to make equip items to raise skills using movements instead of items.xml keys and I thought it'd be easy , but I failed. It's supossed to be a sword that increase your sword skill by 28, but it has no effect when I equip it. No errors in console. I'm using tfs 0.3.6 pl1.
So here I am, asking you, wise community: where's the error?