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

Help with script please :D

JoSePh15_

Well-Known Member
Joined
Jan 28, 2010
Messages
1,766
Reaction score
59
This works for 1 item count lets say i want to make it remove 100 white pieces of cloth and 100 blue pieces of cloth... not 1 can you please help me im kinda confused :(
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
-----------------------------------------------------
 
firstID = 5912          -- id of the first item
secondID = 5909         -- id of the second item 
 
newID = 2307           -- id of the new item
count = 1 -- You get 1 of the new item
 
local piece1pos = {
 
	x = 200, 
	y = 163,    -- Position of the first item
	z = 7,
 
stackpos=1} 
local piece2pos = {
 
	x = 198, 
	y = 163,    -- Position of the second item
	z = 7,
 
-----------------------------------------------------
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
			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) .. ".")
        else
            doPlayerSendTextMessage(cid, 22, "You need " .. getItemArticleById(firstID) .. " "..getItemNameById(firstID).." and " .. getItemArticleById(secondID) .. " "..getItemNameById(secondID)..".")
		end
	else
		doPlayerSendCancel(cid, "You need " .. getItemArticleById(firstID) .. " "..getItemNameById(firstID).." and " .. getItemArticleById(secondID) .. " "..getItemNameById(secondID)..".")
	end
	return TRUE
end
Thanks! i rep++ ;)
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
-----------------------------------------------------
 
firstID = 5912 -- id of the first item
secondID = 5909 -- id of the second item 
 
newID = 2307 -- id of the new item
count = 1 -- You get 1 of the new item
 
local piece1pos = {
 
	x = 200, 
	y = 163,    -- Position of the first item
	z = 7,
 
stackpos=1} 
local piece2pos = {
 
	x = 198, 
	y = 163,    -- Position of the second item
	z = 7,
 
-----------------------------------------------------
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
			doRemoveItem(getpiece1.uid,100) 
			doRemoveItem(getpiece2.uid,100) 
			doSendMagicEffect(piece1pos,2) 
			doSendMagicEffect(piece2pos,2) 
			doPlayerAddItem(cid,newID,count)
			doSendMagicEffect(playerpos,14) 
			doPlayerSendTextMessage(cid, 22, "You have found " .. getItemArticleById(newID) .. " " .. getItemNameById(newID) .. ".")
        else
            doPlayerSendTextMessage(cid, 22, "You need " .. getItemArticleById(firstID) .. " "..getItemNameById(firstID).." and " .. getItemArticleById(secondID) .. " "..getItemNameById(secondID)..".")
		end
	else
		doPlayerSendCancel(cid, "You need " .. getItemArticleById(firstID) .. " "..getItemNameById(firstID).." and " .. getItemArticleById(secondID) .. " "..getItemNameById(secondID)..".")
	end
	return TRUE
end

Maybe try this?
 
nah it wont work the playing is in this
LUA:
if getpiece1.itemid == firstID and getpiece2.itemid == secondID or getpiece1.itemid == secondID and getpiece2.itemid == firstID then
Help please! :D
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
-----------------------------------------------------
 
firstID = 5912 -- id of the first item
secondID = 5909 -- id of the second item 
 
newID = 2307 -- id of the new item
count = 1 -- You get 1 of the new item
 
local piece1pos = {
 
	x = 200, 
	y = 163,    -- Position of the first item
	z = 7,
 
stackpos=1} 
local piece2pos = {
 
	x = 198, 
	y = 163,    -- Position of the second item
	z = 7,
 
-----------------------------------------------------
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
if doRemoveItem(getpiece1.uid,100) and doRemoveItem(getpiece2.uid,100) then
			
			 
			doSendMagicEffect(piece1pos,2) 
			doSendMagicEffect(piece2pos,2) 
			doPlayerAddItem(cid,newID,count)
			doSendMagicEffect(playerpos,14) 
			doPlayerSendTextMessage(cid, 22, "You have found " .. getItemArticleById(newID) .. " " .. getItemNameById(newID) .. ".")
        else
            doPlayerSendTextMessage(cid, 22, "You need " .. getItemArticleById(firstID) .. " "..getItemNameById(firstID).." and " .. getItemArticleById(secondID) .. " "..getItemNameById(secondID)..".")
		end

 
       else
            doPlayerSendTextMessage(cid, 22, "You need " .. getItemArticleById(firstID) .. " "..getItemNameById(firstID).." and " .. getItemArticleById(secondID) .. " "..getItemNameById(secondID)..".")
		end
	else
		doPlayerSendCancel(cid, "You need " .. getItemArticleById(firstID) .. " "..getItemNameById(firstID).." and " .. getItemArticleById(secondID) .. " "..getItemNameById(secondID)..".")
	end
	return TRUE
end

Maybe this? I'm not a real scripter but i think it should be easy. I didn't test.
 
@josef

In your script change
Code:
doRemoveItem(getpiece1.uid,1)

to
Code:
doRemoveItem(getpiece1.uid)

And make this for the rest od doremove function ..
 
ok now if we put 100 on each tile it works but if we put 1 on each tile it still works i want it to work ONLY if we put 100 on each tile please HELP!
 
Back
Top