Manian
User Premium
- Joined
- Jun 30, 2010
- Messages
- 67
- Reaction score
- 1
Hello,
I need help to extend a script but i really dont know too much lua, i tried to edit the script but didnt get good results, it's a fusion item script, the script make this:
you put 2 items in differents sqms, pull a lever and then a new item would be given to the player,i was wondering if its possible to make the same lever with the same action work for many items.
example: like if u put 2 boh get soft boots, if u put 2 swords get a magic sword, but all in the same script, here is the script that only work to fusion 2 item:
PD: srry for my bad english :s.
11/08/2011 I STILL NEED HELP
I need help to extend a script but i really dont know too much lua, i tried to edit the script but didnt get good results, it's a fusion item script, the script make this:
you put 2 items in differents sqms, pull a lever and then a new item would be given to the player,i was wondering if its possible to make the same lever with the same action work for many items.
example: like if u put 2 boh get soft boots, if u put 2 swords get a magic sword, but all in the same script, here is the script that only work to fusion 2 item:
Code:
-- Script by Shawak --
-- Fusion Script v1.0 --
function onUse(cid, item, fromPosition, itemEx, toPosition)
-----------------------------------------------------
firstID = 7426 -- id of the first item
secondID = 7426 -- id of the second item
newID = 3961 -- id of the new item
count = 1 -- You get 1 of the new item
local piece1pos = {
x = 1015,
y = 1027, -- Position of the first item
z = 8,
stackpos=1}
local piece2pos = {
x = 1015,
y = 1029, -- Position of the second item
z = 8,
stackpos=1}
--------------------------------------------------------------
local getpiece1 = getThingfromPos(piece1pos)
local getpiece2 = getThingfromPos(piece2pos)
local playerpos = getPlayerPosition(cid)
if getpiece1.itemid == firstID and getpiece2.itemid == secondID or getpiece1.itemid == secondID and getpiece2.itemid == firstID then
if item.itemid == 1945 then
doTransformItem(item.uid,item.itemid+1)
elseif item.itemid == 1946 then
doTransformItem(item.uid,item.itemid-1)
doRemoveItem(getpiece1.uid,1)
doRemoveItem(getpiece2.uid,1)
doSendMagicEffect(piece1pos,2)
doSendMagicEffect(piece2pos,2)
doPlayerAddItem(cid,newID,count)
doSendMagicEffect(playerpos,14)
doPlayerSendTextMessage(cid, 22, "You have found " .. getItemArticleById(newID) .. " " .. getItemNameById(newID) .. ".")
end
else
doPlayerSendTextMessage(cid, 22, "You need to put 2 fusionable items.")
end
return TRUE
end
PD: srry for my bad english :s.
11/08/2011 I STILL NEED HELP
Last edited: