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

Solved From 9.6 to 8.4

WiLDTuRTLE

Member
Joined
Feb 26, 2011
Messages
478
Reaction score
5
Lua Script Error: [Action Interface]
data/actions/scripts/new/hydra egg.lua:eek:nUse
luaDoRemoveItem(). Item not found

Code:
local config = {
  eff = 30,
  chance = 50, --50% chance spawn the monster
  breakchance = 25, -- 25% chance to break
  monster = 'Hydra', -- monster which will spawn
  msg = "Sorry the monster was dead in your egg.", --msg that will be sent to the player IF the egg 'fails'
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
  if(fromPosition.x == CONTAINER_POSITION) then
      return doPlayerSendCancel(cid, "Please, first put your egg on the floor.")
  end
  if math.random(100) <= config.breakchance then
        doPlayerSendTextMessage(cid, 27, config.msg)
        doRemoveItem(item.uid, 1) 
    end
  if math.random(100) <= config.chance then
    doSendMagicEffect(fromPosition, config.eff)
      doSummonCreature(config.monster, fromPosition)
        doRemoveItem(item.uid, 1) 
  else   
      doSendMagicEffect(fromPosition, 3)
  end
return true                                           
end

The egg disapear tho, i wasnt having that error on 9.6 but id like to remove it from my console anyways!
 
Here you go:
Code:
local config = {
    eff = 30,
      chance = 50, --50% chance spawn the monster
      breakchance = 25, -- 25% chance to break
      monster = 'Hydra', -- monster which will spawn
      msg = "Sorry the monster was dead in your egg.", --msg that will be sent to the player IF the egg 'fails'
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
      if fromPosition.x == CONTAINER_POSITION then
              return doPlayerSendCancel(cid, "Please, first put your egg on the floor.")
      end
      if math.random(100) <= config.breakchance then
            doPlayerSendTextMessage(cid, 27, config.msg)
            doRemoveItem(item.uid, 1)
      elseif math.random(100) <= config.chance then
            doSendMagicEffect(fromPosition, config.eff)
              doSummonCreature(config.monster, fromPosition)
            doRemoveItem(item.uid, 1)
      else 
              doSendMagicEffect(fromPosition, 3)
      end
    return true                                         
end

The error appeard because the player could get the break chance and the win chance at same time, so it try to remove the item twice.
 
Back
Top