function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 1946 then
doSendMagicEffect(toPosition, CONST_ME_POFF)
doTransformItem(item.uid, item.itemid - 1)
elseif doPlayerRemoveItem(cid, 9970, 1) then
doPlayerAddItem(cid, 9971, 1)
doTransformItem(item.uid, 1946)
else
doSendMagicEffect(toPosition, CONST_ME_POFF)
end
return true
end
Ill test when I go to computer after school (itouch now hehe) btw u was the one that called me one idi...0t.... LolLUA:function onUse(cid, item, fromPosition, itemEx, toPosition) if item.itemid == 1946 then doSendMagicEffect(toPosition, CONST_ME_POFF) doTransformItem(item.uid, item.itemid - 1) elseif doPlayerRemoveItem(cid, 9970, 1) then doPlayerAddItem(cid, 9971, 1) doTransformItem(item.uid, 1946) else doSendMagicEffect(toPosition, CONST_ME_POFF) end return true end
Like a switch, actionid X, you use it, remove X items id 9970 (programed on script) and add item Y.
Thanks,
Luciano.
REP+++
<action uniqueid="xxxx" script="the thing you want to put.lua" />
donationsword_id = 8931 -- Item to be sold
custodonationsword_id = 200 -- Value
local name = getItemNameById(donationsword_id)
----- End Config -----
function onUse(cid, item, fromPosition, itemEx, toPosition)
if doPlayerRemoveItem(cid, 6527, 200) == TRUE then ------ change the 6527 to the id of the item you want to be removed from player and 200 = how many of this items the player will get removed
local bag = doPlayerAddItem(cid, donationsword_id, 1)
doSendAnimatedText(fromPosition, "Thanks!", TEXTCOLOR_YELLOW)
doSendMagicEffect(fromPosition, math.random(10, 10) )
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have purchased a ".. name .." for ".. custodonationsword_id .." gold coins.")
for i=1,1 do
end
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need ".. custodonationsword_id .." gold coins for a ".. name ..".")
end
return FALSE
end
I'll make it for you with uid, go to data/actions/actions.xml add this:
Code:<action uniqueid="xxxx" script="the thing you want to put.lua" />
and in data/actions/scripts/the name you would like to put.lua
Code:donationsword_id = 8931 -- Item to be sold custodonationsword_id = 200 -- Value local name = getItemNameById(donationsword_id) ----- End Config ----- function onUse(cid, item, fromPosition, itemEx, toPosition) if doPlayerRemoveItem(cid, 6527, 200) == TRUE then ------ change the 6527 to the id of the item you want to be removed from player and 200 = how many of this items the player will get removed local bag = doPlayerAddItem(cid, donationsword_id, 1) doSendAnimatedText(fromPosition, "Thanks!", TEXTCOLOR_YELLOW) doSendMagicEffect(fromPosition, math.random(10, 10) ) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have purchased a ".. name .." for ".. custodonationsword_id .." gold coins.") for i=1,1 do end else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need ".. custodonationsword_id .." gold coins for a ".. name ..".") end return FALSE end
Rep++
I'll make it for you with uid, go to data/actions/actions.xml add this:
Code:<action uniqueid="xxxx" script="the thing you want to put.lua" />
and in data/actions/scripts/the name you would like to put.lua
Code:donationsword_id = 8931 -- Item to be sold custodonationsword_id = 200 -- Value local name = getItemNameById(donationsword_id) ----- End Config ----- function onUse(cid, item, fromPosition, itemEx, toPosition) if doPlayerRemoveItem(cid, 6527, 200) == TRUE then ------ change the 6527 to the id of the item you want to be removed from player and 200 = how many of this items the player will get removed local bag = doPlayerAddItem(cid, donationsword_id, 1) doSendAnimatedText(fromPosition, "Thanks!", TEXTCOLOR_YELLOW) doSendMagicEffect(fromPosition, math.random(10, 10) ) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have purchased a ".. name .." for ".. custodonationsword_id .." gold coins.") for i=1,1 do end else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need ".. custodonationsword_id .." gold coins for a ".. name ..".") end return FALSE end
Rep++