Hello there.
I want to release my crafting table script.
Tested in 0.4
Do not post your own version of this script here. (Respect)
Well, with this table you put 2 right items to craft another one. When you craft an item it will cost you an amount of premium points! You can add how many more ingredients you want..
I will give you guys 100% noob friendly tutorial.
First of all,
Go to your ot folder and open data/actions/scripts and create new file called crafting.lua and paste this inside :
After that go to data/actions/actions.xml and paste this row :
Configuration is simple:
ingredient1 = The Id of item you need
ingredient2 = The id of second item you need
itemreward = The id of item you will get
name = "Golden Helmet" -- the name of "Itemreward"
points = 50 the amount of points it will cost to craft
Go to RME and make like
And put the unique id in lever like this :
And the local pos in first script :
Put your destination of the right bench, there you will put the items.
Any buggs / feedback just comment. Also feel free to repp =)
I want to release my crafting table script.
Tested in 0.4
Do not post your own version of this script here. (Respect)
Well, with this table you put 2 right items to craft another one. When you craft an item it will cost you an amount of premium points! You can add how many more ingredients you want..
I will give you guys 100% noob friendly tutorial.
First of all,
Go to your ot folder and open data/actions/scripts and create new file called crafting.lua and paste this inside :
LUA:
local items = {
{ingredient1 = 2466, ingredient2 = 2470, itemreward = 2471 , name = "Golden Helmet" , points = 50},
{ingredient1 = 2453, ingredient2 = 2472, itemreward = 2646 , name = "Golden Boots" , points = 25},
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local pos = {x = 979, y = 1461, z = 4}
for i = 1, #items do
local items = items[i]
if getTileItemById(pos, items.ingredient1).uid > 0 and getTileItemById(pos, items.ingredient2).uid > 0 and getPremiumPoints(cid,items.points) > items.points then
if doRemoveItem(getTileItemById(pos, items.ingredient1).uid,1) and doRemoveItem(getTileItemById(pos, items.ingredient2).uid,1) and getPremiumPoints(cid,items.points) > items.points 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(items.ingredient1), getItemInfo(items.ingredient2)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "You have successfully crafted "..first.article.." "..first.name.." and"..second.article.." "..second.name.." for a "..items.name..", the work cost you "..items.points.." points. ")
db.executeQuery('UPDATE accounts SET premium_points=premium_points-'..items.points..' WHERE id=' .. getPlayerAccountId(cid))
doPlayerAddItem(cid, items.itemreward)
return true
end
end
end
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "You dont have the right items or enought of points to craft! ")
return true
end
function getPremiumPoints(cid)
local res = db.getResult('select `premium_points` from accounts where name = \''..getPlayerAccount(cid)..'\'')
if(res:getID() == -1) then
return 0
end
local ret = res:getDataInt("premium_points")
res:free()
return tonumber(ret)
end
After that go to data/actions/actions.xml and paste this row :
LUA:
<action uniqueid="65416" event="script" value="crafttable.lua"/>
Configuration is simple:
ingredient1 = The Id of item you need
ingredient2 = The id of second item you need
itemreward = The id of item you will get
name = "Golden Helmet" -- the name of "Itemreward"
points = 50 the amount of points it will cost to craft
Go to RME and make like

And put the unique id in lever like this :

And the local pos in first script :
LUA:
local pos = {x = 979, y = 1461, z = 4}
Put your destination of the right bench, there you will put the items.
Any buggs / feedback just comment. Also feel free to repp =)



Last edited: