• 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!

Fix script!

Zarabustor

Human Being
Joined
Sep 10, 2009
Messages
186
Reaction score
0
Location
Cancun, Mexico
-- 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.
 
here you are.
ForgottenL hahhahaha lalalalala

Code:
local rustyItems = {
	[9927] = {2128}, --rich helmet
	[8879] = {8880}, --rich armor
	[9928] = {9777}, --rich legs
	[6391] = {6391}, --rich shield
	[7892] = {7893}, --rich boots
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local i = rustyItems[itemEx.itemid]
	if i then
		local newId = i[math.random(#i)]
		doTransformItem(itemEx.uid, newId)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You upgraded your armor to " .. getItemNameById(newId) .. ".")
		doRemoveItem(item.uid, 1)
		return true
	end
end
 
Back
Top