Luciano
Member
- Joined
- Feb 18, 2010
- Messages
- 998
- Reaction score
- 24
I have this script:
it is one switch, that when the player use it remove 5 items of id 9970, and add item X, and send player a message .
If player no have 5 items of id 9970, it says "You need 5 items of id 9970 to buy "itemname".
Actualy i need do over 20 switchs.
With this method, i need do 1 script for every one .
I need help to make those things, config idk,
like
[1] price = 5, prize = itemid, uniqueid = 1313
[2] price = 10, prize = itemid2, uniqueid 1314....
so on actions i put
itemid: switchid - script X
OH! and if possible put to "transform" the switch to its original position....
THanks on advance,
sincerely,
Luciano
Lua:
donationsword_id = 10016 -- Item to be sold
custodonationsword_id = 5 -- Value
local name = getItemNameById(donationsword_id)
----- End Config -----
function onUse(cid, item, fromPosition, itemEx, toPosition)
if doPlayerRemoveItem(cid, 9970, 5) == 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, "Wasted 5!", TEXTCOLOR_YELLOW)
doSendMagicEffect(fromPosition, math.random(10, 10) )
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have purchased a ".. name .." for ".. custodonationsword_id .." Buffary Coins.")
for i=1,1 do
end
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need ".. custodonationsword_id .." Buffary Coins for a ".. name ..".")
end
return FALSE
end
If player no have 5 items of id 9970, it says "You need 5 items of id 9970 to buy "itemname".
Actualy i need do over 20 switchs.
With this method, i need do 1 script for every one .
I need help to make those things, config idk,
like
[1] price = 5, prize = itemid, uniqueid = 1313
[2] price = 10, prize = itemid2, uniqueid 1314....
so on actions i put
itemid: switchid - script X
OH! and if possible put to "transform" the switch to its original position....
THanks on advance,
sincerely,
Luciano