Postado Agosto 24, 2018 6 anos Olá, gostaria da ajuda de voces, tenho esse script e ele esta dando esse erro: ---Config local conf = { maxSlotCount=2, ignoredIds={} } --End function choose(...) local arg = {...} return arg[math.random(1,#arg)] end if not getItemAttack then function getItemAttack(uid) return getItemAttribute(uid,'attack') end function getItemDefense(uid) return getItemAttribute(uid,'defense') end end local function isArmor(uid) -- Function by Mock the bear. if (getItemInfo(uid.itemid).armor ~= 0) and (getItemWeaponType(uid.uid) == 0) then return true end return false end local function isWeapon(uid) -- Function by Mock the bear. uid = uid or 0 local f = getItemWeaponType(uid) if f == 1 or f == 2 or f == 3 then return true end return false end local function isShield(uid) -- Function by Mock the bear. uid = uid or 0 if getItemWeaponType(uid) == 4 then return true end return false end local function isBow(uid) -- Function by Mock the bear. uid = uid or 0 if getItemWeaponType(uid) == 5 and not isItemStackable(uid) then return true end return false end local function getWeaponLevel(uid) -- Function by Mock the bear. uid = uid or 0 local name = getItemName(uid.uid) or getItemInfo(uid.itemid).name or '' local lvl = string.match(name,'%s%+(%d+)%s*') return tonumber(lvl) or 0 end function onUse(cid, item, fromPosition, itemEx, toPosition) if item.uid == 0 or item.itemid == 0 then return false end toPosition.stackpos = 255 if item.uid == 0 or item.itemid == 0 then return false end toPosition.stackpos = 255 if isInArray(conf.ignoredIds, itemEx.itemid) or (not getItemWeaponType(itemEx.uid) or getItemWeaponType(itemEx.uid) > 5) or (getItemWeaponType(itemEx.uid) == 0 and not isArmor(itemEx)) or itemEx.itemid == 0 or itemEx.type > 1 or isItemStackable(itemEx.uid) then doPlayerSendCancel(cid, "You cant reset this item.") return TRUE end if isCreature(itemEx.uid) then return FALSE end local level = getWeaponLevel(itemEx) if level > 0 then upgrade = refine doSendMagicEffect(toPosition,30) setItemName(itemEx.uid, getItemNameById(itemEx.itemid)..' +'..(level)) doPlayerSendCancel(cid, "All slots were removed.") doRemoveItem(item.uid,1) else doSendMagicEffect(toPosition,30) setItemName(itemEx.uid, getItemNameById(itemEx.itemid)) doPlayerSendCancel(cid, "All slots were removed.") doRemoveItem(item.uid,1) end return true end Da o seguinte erro Editado Agosto 24, 2018 6 anos por tetheuscunha (veja o histórico de edições) Senhoras e senhores, se alguma resposta lhe ajudou, marque-a como a melhor resposta e de ponto positivo, assim você incentiva quem lhe ajudou a continuar ajudando!!.
Postado Agosto 25, 2018 6 anos Spoiler ---Config local conf = { maxSlotCount=2, ignoredIds={} } --End function choose(...) local arg = {...} return arg[math.random(1,#arg)] end if not getItemAttack then function getItemAttack(uid) return getItemAttribute(uid,'attack') end function getItemDefense(uid) return getItemAttribute(uid,'defense') end end local function isArmor(uid) -- Function by Mock the bear. if (getItemInfo(uid.itemid).armor ~= 0) and (getItemWeaponType(uid.uid) == 0) then return true end return false end local function isWeapon(uid) -- Function by Mock the bear. uid = uid or 0 local f = getItemWeaponType(uid) if f == 1 or f == 2 or f == 3 then return true end return false end local function isShield(uid) -- Function by Mock the bear. uid = uid or 0 if getItemWeaponType(uid) == 4 then return true end return false end local function isBow(uid) -- Function by Mock the bear. uid = uid or 0 if getItemWeaponType(uid) == 5 and not isItemStackable(uid) then return true end return false end local function getWeaponLevel(uid) -- Function by Mock the bear. uid = uid or 0 local name = getItemName(uid.uid) or getItemInfo(uid.itemid).name or '' local lvl = string.match(name,'%s%+(%d+)%s*') return tonumber(lvl) or 0 end function onUse(cid, item, fromPosition, itemEx, toPosition) if item.uid == 0 or item.itemid == 0 then return false end toPosition.stackpos = 255 if item.uid == 0 or item.itemid == 0 then return false end toPosition.stackpos = 255 if isInArray(conf.ignoredIds, itemEx.itemid) or (not getItemWeaponType(itemEx.uid) or getItemWeaponType(itemEx.uid) > 5) or (getItemWeaponType(itemEx.uid) == 0 and not isArmor(itemEx)) or itemEx.itemid == 0 or itemEx.type > 1 or isItemStackable(itemEx.uid) then doPlayerSendCancel(cid, "You cant reset this item.") return TRUE end if isCreature(itemEx.uid) then return FALSE end local level = getWeaponLevel(itemEx) if level > 0 then upgrade = refine doSendMagicEffect(toPosition,30) doItemSetAttribute(itemEx.uid, 'name', getItemNameById(itemEx.itemid)..' +'..(level)) doPlayerSendCancel(cid, "All slots were removed.") doRemoveItem(item.uid,1) else doSendMagicEffect(toPosition,30) doItemSetAttribute(itemEx.uid, 'name', getItemNameById(itemEx.itemid)) doPlayerSendCancel(cid, "All slots were removed.") doRemoveItem(item.uid,1) end return true end @tetheuscunha ➥ Regras | Seções OTServ | Seções BOT
Postado Agosto 25, 2018 6 anos Autor 39 minutos atrás, Wakon disse: Ocultar conteúdo ---Config local conf = { maxSlotCount=2, ignoredIds={} } --End function choose(...) local arg = {...} return arg[math.random(1,#arg)] end if not getItemAttack then function getItemAttack(uid) return getItemAttribute(uid,'attack') end function getItemDefense(uid) return getItemAttribute(uid,'defense') end end local function isArmor(uid) -- Function by Mock the bear. if (getItemInfo(uid.itemid).armor ~= 0) and (getItemWeaponType(uid.uid) == 0) then return true end return false end local function isWeapon(uid) -- Function by Mock the bear. uid = uid or 0 local f = getItemWeaponType(uid) if f == 1 or f == 2 or f == 3 then return true end return false end local function isShield(uid) -- Function by Mock the bear. uid = uid or 0 if getItemWeaponType(uid) == 4 then return true end return false end local function isBow(uid) -- Function by Mock the bear. uid = uid or 0 if getItemWeaponType(uid) == 5 and not isItemStackable(uid) then return true end return false end local function getWeaponLevel(uid) -- Function by Mock the bear. uid = uid or 0 local name = getItemName(uid.uid) or getItemInfo(uid.itemid).name or '' local lvl = string.match(name,'%s%+(%d+)%s*') return tonumber(lvl) or 0 end function onUse(cid, item, fromPosition, itemEx, toPosition) if item.uid == 0 or item.itemid == 0 then return false end toPosition.stackpos = 255 if item.uid == 0 or item.itemid == 0 then return false end toPosition.stackpos = 255 if isInArray(conf.ignoredIds, itemEx.itemid) or (not getItemWeaponType(itemEx.uid) or getItemWeaponType(itemEx.uid) > 5) or (getItemWeaponType(itemEx.uid) == 0 and not isArmor(itemEx)) or itemEx.itemid == 0 or itemEx.type > 1 or isItemStackable(itemEx.uid) then doPlayerSendCancel(cid, "You cant reset this item.") return TRUE end if isCreature(itemEx.uid) then return FALSE end local level = getWeaponLevel(itemEx) if level > 0 then upgrade = refine doSendMagicEffect(toPosition,30) doItemSetAttribute(itemEx.uid, 'name', getItemNameById(itemEx.itemid)..' +'..(level)) doPlayerSendCancel(cid, "All slots were removed.") doRemoveItem(item.uid,1) else doSendMagicEffect(toPosition,30) doItemSetAttribute(itemEx.uid, 'name', getItemNameById(itemEx.itemid)) doPlayerSendCancel(cid, "All slots were removed.") doRemoveItem(item.uid,1) end return true end @tetheuscunha VLW, funcionou, porem voce pode fazer ele remover so 1 SLOT? e não todos de uma vez??@Wakon Senhoras e senhores, se alguma resposta lhe ajudou, marque-a como a melhor resposta e de ponto positivo, assim você incentiva quem lhe ajudou a continuar ajudando!!.
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.