Dankoo
Active Member
- Joined
- Sep 4, 2010
- Messages
- 1,007
- Reaction score
- 27
I'm trying to make a very simple script
When you use an item, it transforms to another, I've made the following:
Everything smells fine, except player don't receive item, and the item I'm trying to use is a weapon, so when you click it, the cursor appears and nothing happens, but when I set an "non-usable" item to script, it works fine (but don't add the item)
Thanks!!
When you use an item, it transforms to another, I've made the following:
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 12668 then
doSendMagicEffect(fromPosition, 17)
doPlayerAddItem(cid, 12706, 1)
doPlayerRemoveItem(cid, 12688, 1)
elseif item.itemid == 12706 then
doSendMagicEffect(fromPosition, 36)
doPlayerAddItem(cid, 12707, 1)
doPlayerRemoveItem(cid, 12606, 1)
elseif item.itemid == 12707 then
doSendMagicEffect(fromPosition, 43)
doPlayerAddItem(cid, 12708, 1)
doPlayerRemoveItem(cid, 12607, 1)
elseif item.itemid == 12708 then
doSendMagicEffect(fromPosition, 37)
doPlayerAddItem(cid, 12709, 1)
doPlayerRemoveItem(cid, 12608, 1)
elseif item.itemid == 12709 then
doSendMagicEffect(fromPosition, 45)
doPlayerAddItem(cid, 12710, 1)
doPlayerRemoveItem(cid, 12609, 1)
elseif item.itemid == 12710 then
doSendMagicEffect(fromPosition, 39)
doPlayerAddItem(cid, 12668, 1)
doPlayerRemoveItem(cid, 12610, 1)
end
return true
end
Everything smells fine, except player don't receive item, and the item I'm trying to use is a weapon, so when you click it, the cursor appears and nothing happens, but when I set an "non-usable" item to script, it works fine (but don't add the item)
Thanks!!