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

Lua Click on armor = transform...

Joined
Jun 19, 2009
Messages
1,852
Reaction score
5
Hello!

I request a script that goes like this:

If you click on, i.e plate armor, it will transform to dragon scale armor and if you click on dragon scale armor, it will transform to a magic plate armor!

However, after you have clicked on one of the armors, you will have to wait like 3 seconds to transform again...


need this asap and you will get rep!

thanks
 
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local storage, exhausted = 13315, 3
	if(getPlayerStorageValue(cid, storage) > os.time()) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You must wait another " .. getPlayerStorageValue(cid, storage) - os.time() .. ' second' .. ((getPlayerStorageValue(cid, storage) - os.time()) == 1 and "" or "s") .. " to upgrade again.")
	elseif (item.itemid == 8885) then
		doTransformItem(item.uid, 8886)
		doCreatureSay(cid, "Donation Knight Armor!", TALKTYPE_ORANGE_1)
	elseif (item.itemid == 8886) then
		doTransformItem(item.uid, 8887)
		doCreatureSay(cid, "Donation Paladin Armor!", TALKTYPE_ORANGE_1)
	elseif (item.itemid) == 8887 then
		doTransformItem(item.uid, 8885)
		doCreatureSay(cid, "Donation Mage Armor!", TALKTYPE_ORANGE_1)
	end
		setPlayerStorageValue(cid, storage, os.time() + exhausted)
	return true
end

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local storage, exhausted = 13315, 3
	if getPlayerStorageValue(cid, storage) > os.time() then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You must wait another " .. getPlayerStorageValue(cid, storage) - os.time() .. ' second' .. ((getPlayerStorageValue(cid, storage) - os.time()) == 1 and "" or "s") .. " to upgrade again.")
	elseif (item.itemid == 8885) then
		doTransformItem(item.uid, 8886)
		doCreatureSay(cid, "Dragon Scale Armor!", TALKTYPE_ORANGE_1)
		setPlayerStorageValue(cid, storage, os.time() + exhausted)
	elseif (item.itemid == 8886) then
		doTransformItem(item.uid, 8887)
		doCreatureSay(cid, "Magic Plate Armor!", TALKTYPE_ORANGE_1)
		setPlayerStorageValue(cid, storage, os.time() + exhausted)
	elseif (item.itemid == 8887) then
		doTransformItem(item.uid, 8885)
		doCreaturesay(cid, "Plate Armor!", TALKTYPE_ORANGE_1)
		setPlayerStorageValue(cid, storage, os.time() + exhausted)
	end
	return true
end
 
Last edited:
Back
Top Bottom