• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Action Script Rich Set Upgrader

Sir Islam

Never Give Up
Joined
Jun 6, 2008
Messages
504
Solutions
1
Reaction score
117
Location
Suez , Egypt
i use this script Rich Set Upgrader but this clone items this item name ( Rich Set Upgrader ) use in Rich set then Upgrader to anther items like Upgrade Rich helmet

Code:
function onUse(cid, item, frompos, item2, topos)

	if item.itemid == 8306 then 
   
        if getPlayerItemCount(cid,2496,1) < 200 then
            doPlayerAddItem(cid,2501,1)
			doPlayerRemoveItem(cid,8306,1)
			doPlayerRemoveItem(cid,2496,1)
			doPlayerSendTextMessage(cid,21,"Your Rich Helmet has been upgraded!")

	elseif item.itemid == 8306 then 
   
        if getPlayerItemCount(cid,2505,1) < 200 then
			doPlayerAddItem(cid,2503,1)
			doPlayerRemoveItem(cid,8306,1)
			doPlayerRemoveItem(cid,2505,1)
			doPlayerSendTextMessage(cid,21,"Your Rich Armor has been upgraded!")
	
	elseif item.itemid == 8306 then 
   
        if getPlayerItemCount(cid,2507,1) < 200 then
			doPlayerAddItem(cid,2504,1)
			doPlayerRemoveItem(cid,8306,1)
			doPlayerRemoveItem(cid,2507,1)
			doPlayerSendTextMessage(cid,21,"Your Rich Legs has been upgraded!")

	elseif item.itemid == 8306 then 
   
        if getPlayerItemCount(cid,2538,1) < 200 then
			doPlayerAddItem(cid,8905,1)
			doPlayerRemoveItem(cid,8306,1)
			doPlayerRemoveItem(cid,2538,1)
			doPlayerSendTextMessage(cid,21,"Your Rich Shield has been upgraded!")
	
		elseif item.itemid == 8306 then 

        if getPlayerItemCount(cid,2641,1) < 200 then
			doPlayerAddItem(cid,2358,1)
			doPlayerRemoveItem(cid,8306,1)
			doPlayerRemoveItem(cid,2641,1)
			doPlayerSendTextMessage(cid,21,"Your Rich Boots has been upgraded!")
	
			elseif item.itemid == 8306 then 

        if getPlayerItemCount(cid,5907,1) < 200 then
			doPlayerAddItem(cid,7438,1)
			doPlayerRemoveItem(cid,8306,1)
			doPlayerRemoveItem(cid,5907,1)
			doPlayerSendTextMessage(cid,21,"Your Rich Slingshot has been upgraded!")
	

	
			elseif item.itemid == 8306 then 

        if getPlayerItemCount(cid,7417,1) < 200 then
			doPlayerAddItem(cid,8931,1)
			doPlayerRemoveItem(cid,8306,1)
			doPlayerRemoveItem(cid,7417,1)
			doPlayerSendTextMessage(cid,21,"Your Rich Sword has been upgraded!")
	
			elseif item.itemid == 8306 then 

        if getPlayerItemCount(cid,7429,1) < 200 then
            doPlayerAddItem(cid,2437,1)
			doPlayerRemoveItem(cid,8306,1)
			doPlayerRemoveItem(cid,7429,1)
			doPlayerSendTextMessage(cid,21,"Your Rich Club has been upgraded!")
	
			elseif item.itemid == 8306 then 

        if getPlayerItemCount(cid,8924,1) < 200 then
            doPlayerAddItem(cid,8926,1)
			doPlayerRemoveItem(cid,8306,1)
			doPlayerRemoveItem(cid,8924,1)
			doPlayerSendTextMessage(cid,21,"Your Rich Axe has been upgraded!")
	
			elseif item.itemid == 8306 then 

        if getPlayerItemCount(cid,7424,1) < 200 then
			doPlayerAddItem(cid,7958,1)
			doPlayerRemoveItem(cid,8306,1)
			doPlayerRemoveItem(cid,7424,1)
			doPlayerSendTextMessage(cid,21,"Your Rich Mage has been upgraded!")
	
	
       else
           doPlayerSendCancel(cid, "This Item You Try To Uprgade Not Rich !")
       end
end
end
end
end
end
end
end
end
end
   
       return 1
   end
 
I don't understand your request.

Shorter script, but I don't know that it works, you must test it.
LUA:
function onUse(cid, item, frompos, item2, topos)
	local c = {
		[2496] = {add_item = 2501, remove_item = {8306, 2496}},
		[2505] = {add_item = 2503, remove_item = {8306, 2505}},
		[2507] = {add_item = 2504, remove_item = {8306, 2507}},
		[2538] = {add_item = 8905, remove_item = {8306, 2538}}
	}	
	
	if(item.itemid == 8306) then
		for k, v in pairs(c) do
			if(getPlayerItemCount(cid, k, 1) < 200) then
				doPlayerAddItem(cid, v.add_item, 1)
				for i = 1, 2 do
					doPlayerRemoveItem(cid, v.remove_item[i], 1)
				end
				doPlayerSendTextMessage(cid, 21, "Your " .. getItemNameById(v.add_item) .. " has been upgraded!")
			end
		end
	else
		doPlayerSendCancel(cid, "This Item You Try To Uprgade Not Rich!")
		return true
	end
	return true
end
 
The same problem when i put items in The ground and use Rich Set Upgrader on any items in or not in script will clone items from script and no remove Rich Set Upgrader so clone

and doPlayerSendCancel(cid, "This Item You Try To Uprgade Not Rich!") not work because i can use on any items

and for you understand


when use item Rich Set Upgrader id ( 8306 ) on item Rich helmet id ( 2496 )
than add player item Upgrade Rich helmet id ( 2501 )
than remove items Rich Set Upgrader id ( 8306 ) and Rich helmet id ( 2496 )


sorry for bad English
 
Back
Top