• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action Crafting Script!

MadMOOK

Hoo
Joined
Apr 20, 2011
Messages
802
Reaction score
44
Mad Mooks crafting script.
look.jpg

Lets add this to actions.xml
Code:
<action uniqueid="41242" event="script" value="tools/crafting.lua"/>

Now lets create crafting.lua in actions/tools.

Code:
local config = {
  material = 2225
  }
local craftTable = {
  {2195, 1},
  {2149, 5},
  {2160, 1},
  {2063, 1},
  {2127, 1},
  {2160, 2},
  {2160, 3},
  {2477, 1},
  {2476, 1}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local pos = {x = 1934, y = 1989, z = 8}
local rnd = craftTable[math.random(1,#craftTable)]
  if getTileItemById(pos, config.material).uid > 0 then
   if doRemoveItem(getTileItemById(pos,config.material).uid, 1) then

    if item.itemid == 9825 then
    doTransformItem(item.uid, 9826)
    elseif item.itemid == 9826 then
    doTransformItem(item.uid, 9825)
    end

    doPlayerAddItem(cid, rnd[1], rnd[2])
    return true
   end
  end
doPlayerSendTextMessage(cid,MESSAGE_EVENT_ORANGE,"Wrong item on table.")
return true
end

Make sure to add the unique id to the lever in map editor, and change the position to where your crafting tile is.

The table labeled material with itemId 2225, is iron ore. Change it if you like.

If you add new items to local craftTable, be sure to use commas to separate them!

You can change the second numbet to change quantities such as changing the one below to a two
Code:
{2160, 1},
 
Last edited:
The main script goes in GlobalEvents? And is the table at that position or the lever?
 
Last edited:
Do You Call This A Release.? here is someone telling you where to add this
Please Make Your Thread Look Better.it looks bad especially
Code:
By yours truly. Look Summ i made one finaly.
And Post Some Ss on how to use

Make It Look Better.You Will Have My Like Since this is your first Release
 
My only source of internet is my phone, ill edit post when i get to a library. Im getting net in my home next week xD

This is an action Zee.
 
Back
Top