Luiz Oliveira
New Member
- Joined
- May 15, 2014
- Messages
- 8
- Reaction score
- 0
Hello everybody! I'm pretty new with scripts and how they work... Everytime I run my server I get this message:
"[Warning - Actions::registerEvent] Duplicate registered item with id: 5710
[Warning - Actions::registerEvent] Duplicate registered item with id: 2554"
I do understand what it means, and I got 2 .lua files using the IDs above: shovel.lua and leech.lua.
I don't know how to merge both scripts into one simple .lua file, and that's why I'm here looking for some help.
ID: 5710 (Shovel)
ID: 2554 (Light Shovel)
Here's my leech.lua script:
local config = {
waters = {18580, 18581, 18582, 18583, 18584, 18585, 18586, 18587, 18588, 18589, 18590, 20230 , 18593 , 18594 , 18595 , 18596 , 18597 , 18598 , 18599 , 18600 , 18601 , 18602 , 18603 , 18604}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(isInArray(config.waters, itemEx.itemid)) and (math.random(1,40) <= 1) then
doPlayerAddItem(cid, 20138)
doCreatureSay(cid, "You Found a Leech!", TALKTYPE_ORANGE_1)
return true
elseif(isInArray(config.waters, itemEx.itemid)) and (math.random(7,10) <= 7) then
doPlayerAddItem(cid, 2817)
doCreatureSay(cid, "Again dead snake?! Again? I guess I'll have to dig more!", TALKTYPE_ORANGE_1)
return true
elseif(isInArray(config.waters, itemEx.itemid)) and (math.random(2,10) <= 2) then
doPlayerAddItem(cid, 2817)
doCreatureSay(cid, "You Found a Small Diamond!", TALKTYPE_ORANGE_1)
return true
end
return true
end
And here's my shovel.lua script:
local holes = {468, 481, 483}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if isInArray(holes, itemEx.itemid) then
local iEx = Item(itemEx.uid)
iEx:transform(itemEx.itemid + 1)
iEx:decay()
elseif itemEx.itemid == 231 then
local rand = math.random(1, 100)
if rand == 1 then
Game.createItem(2159, 1, toPosition)
elseif rand > 95 then
Game.createMonster("Scarab", toPosition)
end
toPosition:sendMagicEffect(CONST_ME_POFF)
else
return false
end
return true
end
The leech.lua file is being used to get the mount item (water buffalo). I already tried to merge both scripts into one .lua file, but it doesn't work.
Can you guys help me out? Best regards,
Luiz Oliveira
"[Warning - Actions::registerEvent] Duplicate registered item with id: 5710
[Warning - Actions::registerEvent] Duplicate registered item with id: 2554"
I do understand what it means, and I got 2 .lua files using the IDs above: shovel.lua and leech.lua.
I don't know how to merge both scripts into one simple .lua file, and that's why I'm here looking for some help.
ID: 5710 (Shovel)
ID: 2554 (Light Shovel)
Here's my leech.lua script:
local config = {
waters = {18580, 18581, 18582, 18583, 18584, 18585, 18586, 18587, 18588, 18589, 18590, 20230 , 18593 , 18594 , 18595 , 18596 , 18597 , 18598 , 18599 , 18600 , 18601 , 18602 , 18603 , 18604}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(isInArray(config.waters, itemEx.itemid)) and (math.random(1,40) <= 1) then
doPlayerAddItem(cid, 20138)
doCreatureSay(cid, "You Found a Leech!", TALKTYPE_ORANGE_1)
return true
elseif(isInArray(config.waters, itemEx.itemid)) and (math.random(7,10) <= 7) then
doPlayerAddItem(cid, 2817)
doCreatureSay(cid, "Again dead snake?! Again? I guess I'll have to dig more!", TALKTYPE_ORANGE_1)
return true
elseif(isInArray(config.waters, itemEx.itemid)) and (math.random(2,10) <= 2) then
doPlayerAddItem(cid, 2817)
doCreatureSay(cid, "You Found a Small Diamond!", TALKTYPE_ORANGE_1)
return true
end
return true
end
And here's my shovel.lua script:
local holes = {468, 481, 483}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if isInArray(holes, itemEx.itemid) then
local iEx = Item(itemEx.uid)
iEx:transform(itemEx.itemid + 1)
iEx:decay()
elseif itemEx.itemid == 231 then
local rand = math.random(1, 100)
if rand == 1 then
Game.createItem(2159, 1, toPosition)
elseif rand > 95 then
Game.createMonster("Scarab", toPosition)
end
toPosition:sendMagicEffect(CONST_ME_POFF)
else
return false
end
return true
end
The leech.lua file is being used to get the mount item (water buffalo). I already tried to merge both scripts into one .lua file, but it doesn't work.
Can you guys help me out? Best regards,
Luiz Oliveira