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

Close Thread please.

Lava Titan

Developer
Joined
Jul 25, 2009
Messages
1,571
Solutions
3
Reaction score
98
Location
Portugal
Hello!

I tryed to make a script but it failed >.< so i wanted to know if any1 can help me on this i think its easy:

Btw i'm using

TFS: 0.3.4
Script type: Action


When we use a Present Bag (ID: 6497) it will give a Backpack Of Holding (ID: 2365) with deco items inside it.
When we use the Present bag it will do a magic effect (CONST_ME_WATERCREATURE) and send magic text Decorating! (TEXTCOLOR_TEAL) and then it will give the Backpack Of Holding.

Inside the backpack of holding:
(Deco items id: 2798, 7759, 7761, 7760, 7762, 6543, 6544, 6542, 6541, 2695, 6545, 9690, 5879, 9971, 8614, 2113, 2151, 2145)

Tnx for your help!
 
would that be?

items =
{
2798,7759,7761,7760,7762,
6543,6544,6542,6541,2695,
6545,9690,5879,9971,8614,
2113,2151,2145
}

function onUse(cid, item, fromPosition, itemEx, toPosition)

doSendMagicEffect(getCreaturePosition(cid),CONST_ME_WATERCREATURE)
bp = doPlayerAddItem(cid, 2365)
for i=1,#items do
doAddContainerItem(bp.uid,items)
end
return TRUE
end
 
Hmm i changed some things on the script:

LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)

doSendMagicEffect(getCreaturePosition(cid),CONST_ME_WATERCREATURE)
doCreatureSay(cid, "You used a Decoration Packdage!!!" ,19)
bp = doPlayerAddItem(cid, 2365)
inside = doPlayerAddItem(cid, 2798, 100)
inside = doPlayerAddItem(cid, 7759, 100)
inside = doPlayerAddItem(cid, 7761, 100)
inside = doPlayerAddItem(cid, 7760, 100)
inside = doPlayerAddItem(cid, 7762, 100)
inside = doPlayerAddItem(cid, 6543, 100)
inside = doPlayerAddItem(cid, 6544, 100)
inside = doPlayerAddItem(cid, 6542, 100)
inside = doPlayerAddItem(cid, 6541, 100)
inside = doPlayerAddItem(cid, 2695, 100)
inside = doPlayerAddItem(cid, 6545, 100)
inside = doPlayerAddItem(cid, 9690, 100)
inside = doPlayerAddItem(cid, 5879, 100)
inside = doPlayerAddItem(cid, 9971, 100)
inside = doPlayerAddItem(cid, 8614, 100)
inside = doPlayerAddItem(cid, 2113, 1)
inside = doPlayerAddItem(cid, 2151, 100)
inside = doPlayerAddItem(cid, 2145, 100)
for i=1,#items do
doAddContainerItem(bp.uid,items[i])
return doRemoveItem(item.uid)
end
return true
end

But the deco packdage doesnt desapear.

maybe if i add local packdageid = 6497
 
LUA:
  backpack = {
   {id = 2798, amount = 1},
   {id = 7759, amount = 1},
   {id = 7761, amount = 1},
   {id = 7760, amount = 1},
   {id = 7762, amount = 1},
   {id = 6543, amount = 1},
   {id = 6544, amount = 1},
   {id = 6542, amount = 1},
   {id = 6541, amount = 1},
   {id = 2695, amount = 1},
   {id = 6545, amount = 1},
   {id = 9690, amount = 1},
   {id = 5879, amount = 1},
   {id = 9971, amount = 1},
   {id = 8614, amount = 1},
   {id = 2113, amount = 1},
   {id = 2151, amount = 1},
   {id = 2145, amount = 1},
  }
function onUse(cid, item, frompos, item2, topos)
	for _, i in ipairs(backpack) do
	  bp = doPlayerAddItem(cid, 1988, 1)
	  doAddContainerItem(bp, i.id, i.amount)
	end
return doRemoveItem(item.uid)
end
 
LUA:
  backpack = {
   {id = 2798, amount = 1},
   {id = 7759, amount = 1},
   {id = 7761, amount = 1},
   {id = 7760, amount = 1},
   {id = 7762, amount = 1},
   {id = 6543, amount = 1},
   {id = 6544, amount = 1},
   {id = 6542, amount = 1},
   {id = 6541, amount = 1},
   {id = 2695, amount = 1},
   {id = 6545, amount = 1},
   {id = 9690, amount = 1},
   {id = 5879, amount = 1},
   {id = 9971, amount = 1},
   {id = 8614, amount = 1},
   {id = 2113, amount = 1},
   {id = 2151, amount = 1},
   {id = 2145, amount = 1},
  }
function onUse(cid, item, frompos, item2, topos)
	for _, i in ipairs(backpack) do
	  bp = doPlayerAddItem(cid, 1988, 1)
	  doAddContainerItem(bp, i.id, i.amount)
	end
return doRemoveItem(item.uid)
end

lol it added one bp each item so it added like 18 bps =/ it should be all the items inside the backpack
 
LUA:
  backpack = {
   {id = 2798, amount = 1},
   {id = 7759, amount = 1},
   {id = 7761, amount = 1},
   {id = 7760, amount = 1},
   {id = 7762, amount = 1},
   {id = 6543, amount = 1},
   {id = 6544, amount = 1},
   {id = 6542, amount = 1},
   {id = 6541, amount = 1},
   {id = 2695, amount = 1},
   {id = 6545, amount = 1},
   {id = 9690, amount = 1},
   {id = 5879, amount = 1},
   {id = 9971, amount = 1},
   {id = 8614, amount = 1},
   {id = 2113, amount = 1},
   {id = 2151, amount = 1},
   {id = 2145, amount = 1},
  }
function onUse(cid, item, frompos, item2, topos)
        bp = doPlayerAddItem(cid, 1988, 1)
		for _, i in ipairs(backpack) do
          doAddContainerItem(bp, i.id, i.amount)
        end
return doRemoveItem(item.uid)
end

Try this one...
 
Back
Top