tiddpd
PHP Scripter
- Joined
- Apr 16, 2008
- Messages
- 331
- Reaction score
- 0
Hello I am trying to make a exp rate ring, I am using the base of the following script on tfs 0.3.6, but the server crashses when the ring is equipped or de-equipped, its either at random.
However when it is equipped the exp rate does work, it just crashes when equipped or de-equipped.
LUA Code
XML code:
However when it is equipped the exp rate does work, it just crashes when equipped or de-equipped.
LUA Code
Code:
-- Credits: Slawkens & Barker
function onDeEquip(cid, item, slot)
if(item.itemid == 6301) then
doPlayerSetRate(cid, SKILL__LEVEL, 1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Reg exp")
doTransformItem(item.uid, 6300)
end
end
function onEquip(cid, item, slot)
if(item.itemid == 6300) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Double exp.")
doPlayerSetRate(cid, SKILL__LEVEL, 2)
doTransformItem(item.uid, 6301)
return true
end
end
XML code:
Code:
<movevent type="Equip" itemid="6301" slot="ring" event="function" value="onEquipItem"/>
<movevent type="Equip" itemid="6300" slot="ring" event="script" value="script.lua"/>
<movevent type="DeEquip" itemid="6301" slot="ring" event="script" value="script.lua"/>