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

transform item

UpInSmoke

Supreme Ruler
Joined
Nov 16, 2008
Messages
303
Reaction score
21
so i want an item that when a different item is used on it, that it transforms to a different item - (works)
now i want to set an event to when it transforms so in x amount of time it will transform back, the event works, but i cant see to get it to transform back.

I have tried, removing the item (which doesnt seem to work, maybe i dont know how to properly use that function) and then creating it again, creating works, removing doesnt.

Let me give abit more information on this script, so the script works when a certian item is used on a list of different items, these items dont have uniqueid or action id so it works on
Code:
XXXX = YYYY[itemEx.itemid]
now here is what i am trying to do non of which works, (for removing or transforming, doesnt matter just need one of them to work)
Code:
doRemoveItem(rockPos,t.depletedRock,1)
doRemoveItem(getTileItemById(rockPos,rockId).uid)
doTransformItem(item.uid,rockId)
doTransformItem(RockPos,rockId)
doTransformItem(itemEx.itemid,rockId)

ofcourse im not using all of these at once, i simply comment it out and keep trying new ones, these are all the ones i have tried and all failed.
Anybody got any ideas? :rolleyes:
 
look
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local item = 5152 -- before using it
local time = 60
local items = {5152, 5162,6221, xxx}
  if item.itemid == item and isInArray(items, item.itemid) then
    doTransformItem(item.uid, xxx)-- after using it
    doPlayerSendTextMessage(cid, 14,"You have Changed xx to xx")
    addEvent(doTransformItem, item.uid, time*1000, item)
else
    doPlayerSendCancel(cid, "Sry Not Possible.")
end
return true
end

if it didn't work message me and i will try it on my server
 
thanks but it didnt work
Code:
[06/07/2013 13:54:38] [Error - Action Interface] 
[06/07/2013 13:54:38] In a timer event called from: 
[06/07/2013 13:54:38] data/actions/scripts/other/test.lua:onUse
[06/07/2013 13:54:38] Description: 
[06/07/2013 13:54:38] (luaDoTransformItem) Item not found
did this:
Code:
addEvent(doTransformItem, item.uid, rock[8]*1000, rock[1])
tried
Code:
addEvent(doTransformItem, itemEx.uid, rock[8]*1000, rock[1])
both didnt work :(
 
What? the item is already in the map editor and its an action not a movement if thats what you are trying to get at
 
Last edited:
Back
Top