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

Aggregation an item with script

Na Amigo

The crazy girl
Joined
Jun 5, 2017
Messages
254
Solutions
3
Reaction score
17
Location
Egypt
Hello otlanders i want aggregation some item with pieces. the pieces is :-
2341
2340
2339
2338
2337
2336
2335
if you have those items right click at any one to get the ancient helmet "2342" if you don't have one from any those items get player a message " you dont have the requirements for the process". sorry i am not good at english this my script has a lot of mistakes. i want make this script
 
Untested.
XML:
<action itemid="2335-2341" event="script" value="script_name.lua"/>
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
   for i = 2335, 2341 do
       if getPlayerItemCount(cid, i) < 1 then
           doSendMagicEffect(fromPosition, CONST_ME_POFF)
           doPlayerSendCancel(cid, "You dont have the requirements for this process.")
           return true
       end
   end
   for i = 2335, 2341 do
       doPlayerRemoveItem(cid, i, 1)
   end
   doPlayerAddItem(cid, 2342, 1, true)
   return true
end
 
Untested.
XML:
<action itemid="2335-2341" event="script" value="script_name.lua"/>
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
   for i = 2335, 2341 do
       if getPlayerItemCount(cid, i) < 1 then
           doSendMagicEffect(fromPosition, CONST_ME_POFF)
           doPlayerSendCancel(cid, "You dont have the requirements for this process.")
           return true
       end
   end
   for i = 2335, 2341 do
       doPlayerRemoveItem(cid, i, 1)
   end
   doPlayerAddItem(cid, 2342, 1, true)
   return true
end
thanks for your reply, i have an xml server 8.1 "Aries 0.4.0" while i use any items for test it not working nothing happen
 
thanks for your reply, i have an xml server 8.1 "Aries 0.4.0" while i use any items for test it not working nothing happen
Well really there's only 3 things that can be happening.

1. There's an error in console.
2. Your getting an error message in-game.
3. The items are being removed.

Ergo, 2 & 3 aren't happening, I guess you gotta check #1.
 
Well really there's only 3 things that can be happening.

1. There's an error in console.
2. Your getting an error message in-game.
3. The items are being removed.

Ergo, 2 & 3 aren't happening, I guess you gotta check #1.
first, no error in the console
while i use any item it send a message "you can not use this object"
nothing remove
 
Back
Top