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

Click on items

semary

[BB] OTland
Joined
May 3, 2009
Messages
813
Reaction score
18
Location
E G Y P T
i need actions or script what ever

what it do ?

example when i click on items it change to other items
 
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(fromPosition.x ~= CONTAINER_POSITION) then
		doSendMagicEffect(fromPosition, CONST_ME_BIGCLOUDS)
	end

	local value = math.random(XXXX, XXXX) --set the items it can change into--
	doTransformItem(item.uid, value)
	return true
end

or if you want it to turn into 1 single item
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(fromPosition.x ~= CONTAINER_POSITION) then
                doTransformItem(item.uid, XXXX) -- new item it turns into --
		doSendMagicEffect(fromPosition, CONST_ME_BIGCLOUDS)
	end
	return true
end
 
Last edited:
PHP:
local value =  math.random(XXXX, XXXX) --set the items it can change into--

Kool
but you should do it like this:
PHP:
local items = {1,2,3,4}
local value = items[math.random(#items)]

Also why do you check if the item is on ground?
>if(fromPosition.x ~= CONTAINER_POSITION) then
 
just because a player could use it by accident it it was in a house for deco or something, i thought it would work better from in a container then only the holder of the weapon can choose to change it.

thanks for the update, makes more sence your way :)
 
Back
Top