president vankk
Web Developer & AuraOT Owner
- Joined
- Jul 10, 2009
- Messages
- 5,719
- Solutions
- 9
- Reaction score
- 339
I wanted a script that you use when you purchase one from sudden death rune with 25x and so on ...
shopModule:addBuyableItem({'backpack'}, 1987, 25, 'backpack')
local shop = {
[1000] = {
rune = 2268, cost = 5000, charges = 3, effect = CONST_ME_GIFT_WRAPS
},
[1001] = {
rune = 2273, cost = 3000, charges = 3, effect = CONST_ME_GIFT_WRAPS
}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local v = shop[item.actionid]
if getPlayerMoney(cid) < v.cost then
doPlayerSendCancel(cid, "You need " .. v.cost .. " gold to buy this item.")
elseif getPlayerFreeCap(cid) < getItemInfo(v.rune).weight then
doPlayerSendCancel(cid, "You need " .. string.format("%.2f", getItemInfo(v.rune).weight) .. " oz. to take this item.")
else
local k = doCreateItemEx(v.rune, v.charges)
if doPlayerAddItemEx(cid, k) ~= RETURNVALUE_NOERROR then
doPlayerSendCancel(cid, "You don't have enough space.")
else
doPlayerRemoveMoney(cid, v.cost)
doSendMagicEffect(getThingPos(cid), v.effect)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have purchased a backpack of " .. getItemInfo(v.rune).plural .. ".")
doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
end
end
return true
end
function onUse(cid, item, frompos, item2, topos)
local cost = 3400
local charges = 25
if doPlayerRemoveMoney(cid, cost) == TRUE then
doPlayerAddItem(cid, 2268, charges)
doPlayerSendTextMessage(cid,22,"You have bought SD.")
else
doPlayerSendTextMessage(cid,22,"You don/'t have engouh money.")
end
end
shit mangDon't worked fr me
neither do work for you, ok. you gotta use do an while external skrypt* get while accidentally the whole skrypts so what do??????????Any ofthese 2 worked for me..
@up
spamm blz
thats why u r banned user gz
function onUse(cid, item, frompos, item2, topos)
local cost = 3400
local charges = 25
if doPlayerRemoveMoney(cid, cost) == TRUE then
doPlayerAddItem(cid, 2268, charges)
doPlayerSendTextMessage(cid,22,"You have bought SD.")
else
doPlayerSendTextMessage(cid,22,"You don/'t have engouh money.")
end
end