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

Request Script.

Cornex

Web Developer
Staff member
Global Moderator
Joined
Jun 15, 2008
Messages
3,443
Solutions
6
Reaction score
1,170
Location
Sweden
Hello dear otlander.

I want an script like upgrading table. You put 2 items and pull the lever or something and it creates to one better item.
Someone can do this?

I would be gratefull :)

Cheers
 
LUA:
local items = {
	{2112, 3954, 2520}, -- first 2 items are the first ones, the last one is the new one
	{2666, 5896, 2671}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)

local pos = {x = 100, y = 100, z = 7}	

    	for i = 1, #items do
		local x = items[i]
		if getTileItemById(pos, x[1]).uid > 0 and getTileItemById(pos, x[2]).uid > 0 then
			if doRemoveItem(getTileItemById(pos, x[1]).uid,1) and doRemoveItem(getTileItemById(pos, x[2]).uid,1) then
				if item.itemid == 1945 then
					doTransformItem(item.uid, 1946)
				elseif item.itemid == 1946 then
					doTransformItem(item.uid, 1945)
				end
				local first, second, third = getItemInfo(x[1]), getItemInfo(x[2]), getItemInfo(x[3])
				doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "You changed "..first.article.." "..first.name.." and "..second.article.." "..second.name.." for "..third.article.." "..third.name..".")
				doPlayerAddItem(cid, x[3], 1)
				return true
			end
		end
	end  
   	doPlayerSendTextMessage(cid, 22, "You have to place the right items on the table.") 
   	return true
end
 
Last edited:
Back
Top