Zarabustor
Human Being
-- Bolsudo --
local oldSethelmet = 2663
local oldSetarmor = 8878
local oldSetshield = 2538
local oldSetlegs = 7730
local oldSetboots = 7892
local newSethelmet = 2139
local newSetarmor = 8877
local newSetshield = 8905
local newSetlegs = 9777
local newSetboots = 7891
function onUse(cid, item, fromPosition, itemEx, toPosition)
doPlayerSendCancel(cid,"You can only upgrade rich pieces.")
if doPlayerRemoveItem(cid, oldSethelmet,1) == TRUE then
doPlayerRemoveItem(cid,oldSethelmet,1)
doPlayerAddItem(cid, newSethelmet, 1)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_ASSASSIN)
doSendAnimatedText(getPlayerPosition(cid), "UPGRADE!", TEXTCOLOR_WHITE)
doRemoveItem(item.uid, 1)
elseif doPlayerRemoveItem(cid, oldSetarmor,1) == TRUE then
doPlayerRemoveItem(cid,oldSetarmor,1)
doPlayerAddItem(cid, newSetarmor, 1)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_ASSASSIN)
doSendAnimatedText(getPlayerPosition(cid), "UPGRADE!", TEXTCOLOR_WHITE)
doRemoveItem(item.uid, 1)
elseif doPlayerRemoveItem(cid, oldSetshield,1) == TRUE then
doPlayerRemoveItem(cid,oldSetshield,1)
doPlayerAddItem(cid, newSetshield, 1)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_ASSASSIN)
doSendAnimatedText(getPlayerPosition(cid), "UPGRADE!", TEXTCOLOR_WHITE)
doRemoveItem(item.uid, 1)
elseif doPlayerRemoveItem(cid, oldSetlegs,1) == TRUE then
doPlayerRemoveItem(cid,oldSetlegs,1)
doPlayerAddItem(cid, newSetlegs, 1)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_ASSASSIN)
doSendAnimatedText(getPlayerPosition(cid), "UPGRADE!", TEXTCOLOR_WHITE)
doRemoveItem(item.uid, 1)
elseif doPlayerRemoveItem(cid, oldSetboots,1) == TRUE then
doPlayerRemoveItem(cid,oldSetboots,1)
doPlayerAddItem(cid, newSetboots, 1)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_ASSASSIN)
doSendAnimatedText(getPlayerPosition(cid), "UPGRADE!", TEXTCOLOR_WHITE)
doRemoveItem(item.uid, 1)
end
return TRUE
end
Help me with this script, i want make it work better.
When i use the item on the old armor it upgrade randomnly the piece.