• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Remove X items of id 9970, add item Y

Luciano

Member
Joined
Feb 18, 2010
Messages
998
Reaction score
24
Like a switch, actionid X, you use it, remove X items id 9970 (programed on script) and add item Y.
Thanks,
Luciano.

REP+++
 
LUA:
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
 
LUA:
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.... Lol
 
Like a switch, actionid X, you use it, remove X items id 9970 (programed on script) and add item Y.
Thanks,
Luciano.

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++
 
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++

Give credits to who really made that script please
 
reped ty
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++
 
Back
Top