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

[LUA] Create Boss from fishbowl, summon error

ares413

New Member
Joined
Apr 1, 2010
Messages
130
Reaction score
3
i have a script, sorta like a capturing a pet system, but im trying to change into where you right click the fish bowl, and it creates a monster that attacks everyone, NOT a summoned creature. currently everything in the script works 100% except that part, heres my script:

Code:
local storage = 56487

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local desc = getItemAttribute(item.uid, 'description') == nil and getItemInfo(item.itemid).description or getItemAttribute(item.uid, 'description')

    if not isCreature(itemEx.uid) then
        if getCreatureStorage(cid, storageLol) < os.time() then
            if string.find(desc:lower(), 'catched monster:') ~= nil then
                local x, y = string.find(desc, ': %a+.')
                local a, b = string.find(desc, ': %a+ %a+.')
               
                if a ~= nil then
                    if #getCreatureSummons(cid) == 0 then
                        doSummonMonster(cid, string.sub(desc, a + 2, b - 1))
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You summoned a monster.')
                        doRemoveItem(item.uid, 1)
                    else
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You\'ve already summoned a monster.')
                    end
                elseif x ~= nil then
                    if #getCreatureSummons(cid) == 0 then
                        doSummonCreature(cid, string.sub(desc, x + 2, y - 1))
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You summoned a monster.')
                        doRemoveItem(item.uid, 1)
                    else
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You\'ve already summoned a monster.')
                    end
                else
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Unknown monster.')
                end
            else
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You didn\'t catch anything into the bottle.')
            end
        else
            doPlayerSendCancel(cid, 'You need to wait before summoning it again.')
        end
    elseif itemEx.uid == cid then
        if #getCreatureSummons(cid) > 0 then
            if string.find(desc:lower(), 'catched monster:') ~= nil then
                local x, y = string.find(desc, ': %a+.')
                local a, b = string.find(desc, ': %a+ %a+.')
               
                if a ~= nil then
                    for k, v in pairs(getCreatureSummons(cid)) do
                        if getCreatureName(v):lower() == string.sub(desc, a + 2, b - 1) then
                            doRemoveCreature(v)
                            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Your monster is back to the bottle.')
                            break
                        end
                    end       
                elseif x ~= nil then
                    for k, v in pairs(getCreatureSummons(cid)) do
                        if getCreatureName(v):lower() == string.sub(desc, x + 2, y - 1) then
                            doRemoveCreature(v)
                            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Your monster is back to the bottle.')
                            break
                        end
                    end               
                else
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Unknown monster.')
                end
            else
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You didn\'t catch anything into the bottle.')
            end
        else
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You didn\'t summon anything.')
        end
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You can summon a catched monster if you use it on a tile or on ur self if you want to summon it back to the bottle.')
    end
    return true
end

please help rep++
 
Heres the other script this script refers to, this is the release script, heres the capture script :
Code:
local t = {
    percent = 40,
    monsters = {
        ['wyrm'] = 75, 
        ['sea serpent'] = 75,
        ['quara constrictor'] = 70,
        ['quara hydromancer'] = 60,
        ['quara mantassin'] = 40,
        ['quara pincher'] = 40,
        ['quara predator'] = 20,
        ['massive water elemental'] = 10,
    },
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local desc = getItemAttribute(item.uid, 'description') == nil and getItemInfo(item.itemid).description or getItemAttribute(item.uid, 'description')
   
    if isMonster(itemEx.uid) then
        if t.monsters[getCreatureName(itemEx.uid):lower()] then
            if getCreatureHealth(itemEx.uid) <= getCreatureMaxHealth(itemEx.uid) * t.percent / 100 then
                local desc = getItemAttribute(item.uid, 'description') == nil and getItemInfo(item.itemid).description or getItemAttribute(item.uid, 'description')
                if string.find(desc:lower(), 'catched monster:') == nil then
                    if math.random(1, 100) < t.monsters[getCreatureName(itemEx.uid):lower()] then
                        doSendMagicEffect(toPosition, CONST_ME_YALAHARIGHOST)
                       
                        local newItem = doPlayerAddItem(cid, 5929, 1)
                        doItemSetAttribute(newItem, 'description', desc .. ' Catched monster: ' .. getCreatureName(itemEx.uid):lower() .. '. ' .. getCreatureName(cid) .. ' has catched this monster.')
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You successfuly catched ' .. getCreatureName(itemEx.uid):lower() .. ' into the fish bowl.')
                        doRemoveCreature(itemEx.uid)
                    else
                        doSendMagicEffect(toPosition, CONST_ME_GROUNDSHAKER)
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You failed at capturing monster.')
                        doRemoveCreature(itemEx.uid)
                    end
                    doRemoveItem(item.uid)
                else
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You can\'t catch two monsters into same bottle.')
                end
            else
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Creature do not have require low health.')
            end
        else
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You can use it only on specific monsters.')
        end
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You can use it only on monsters.')
    end
    return true
end
 
Last edited:
Code:
local storage = 56487

function onUse(cid, item, fromPosition, itemEx, toPosition)
local desc = getItemAttribute(item.uid, 'description') == nil and getItemInfo(item.itemid).description or getItemAttribute(item.uid, 'description')

if not isCreature(itemEx.uid) then
if getCreatureStorage(cid, storageLol) < os.time() then
if string.find(desc:lower(), 'catched monster:') ~= nil then
local x, y = string.find(desc, ': %a+.')
local a, b = string.find(desc, ': %a+ %a+.')

if a ~= nil then
if #getCreatureSummons(cid) == 0 then
doSummonCreature(cid, string.sub(desc, a + 2, b - 1))
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You summoned a monster.')
doRemoveItem(item.uid, 1)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You\'ve already summoned a monster.')
end
elseif x ~= nil then
if #getCreatureSummons(cid) == 0 then
doSummonCreature(cid, string.sub(desc, x + 2, y - 1))
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You summoned a monster.')
doRemoveItem(item.uid, 1)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You\'ve already summoned a monster.')
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Unknown monster.')
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You didn\'t catch anything into the bottle.')
end
else
doPlayerSendCancel(cid, 'You need to wait before summoning it again.')
end
elseif itemEx.uid == cid then
if #getCreatureSummons(cid) > 0 then
if string.find(desc:lower(), 'catched monster:') ~= nil then
local x, y = string.find(desc, ': %a+.')
local a, b = string.find(desc, ': %a+ %a+.')

if a ~= nil then
for k, v in pairs(getCreatureSummons(cid)) do
if getCreatureName(v):lower() == string.sub(desc, a + 2, b - 1) then
doRemoveCreature(v)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Your monster is back to the bottle.')
break
end
end
elseif x ~= nil then
for k, v in pairs(getCreatureSummons(cid)) do
if getCreatureName(v):lower() == string.sub(desc, x + 2, y - 1) then
doRemoveCreature(v)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Your monster is back to the bottle.')
break
end
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Unknown monster.')
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You didn\'t catch anything into the bottle.')
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You didn\'t summon anything.')
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You can summon a catched monster if you use it on a tile or on ur self if you want to summon it back to the bottle.')
end
return true
end
 
Still not working, please help!
Code:
[16:22:51.290] [Error - Action Interface]
[16:22:51.290] data/actions/scripts/AOD/release2.lua:onUse
[16:22:51.291] Description:
[16:22:51.291] (luaDoCreateMonster) Monster with name '268454640' not found
I/O warning : failed to load external entity "data/npc/268454640.xml"
[16:22:51.293] [Warning - Npc::loadFromXml] Cannot load npc file (data/npc/268454640.xml).
[16:22:51.293] Info: failed to load external entity "data/npc/268454640.xml"
 
these are the original scripts that worked only they summon the monster they dont spawn it. original capture script:
Code:
local t = {
    percent = 40,
    monsters = {
        ['wyrm'] = 75, 
        ['sea serpent'] = 75,
        ['quara constrictor'] = 70,
        ['quara hydromancer'] = 60,
        ['quara mantassin'] = 40,
        ['quara pincher'] = 40,
        ['quara predator'] = 20,
        ['massive water elemental'] = 10,
    }
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local desc = getItemAttribute(item.uid, 'description') == nil and getItemInfo(item.itemid).description or getItemAttribute(item.uid, 'description')
   
    if isMonster(itemEx.uid) then
        if t.monsters[getCreatureName(itemEx.uid):lower()] then
            if getCreatureHealth(itemEx.uid) <= getCreatureMaxHealth(itemEx.uid) * t.percent / 100 then
                local desc = getItemAttribute(item.uid, 'description') == nil and getItemInfo(item.itemid).description or getItemAttribute(item.uid, 'description')
                if string.find(desc:lower(), 'catched monster:') == nil then
                    if math.random(1, 100) < t.monsters[getCreatureName(itemEx.uid):lower()] then
                        doSendMagicEffect(toPosition, CONST_ME_YALAHARIGHOST)
                       
                        local newItem = doPlayerAddItem(cid, 5929, 1)
                        doItemSetAttribute(newItem, 'description', desc .. ' Catched monster: ' .. getCreatureName(itemEx.uid):lower() .. '. ' .. getCreatureName(cid) .. ' has catched this monster.')
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You successfuly catched ' .. getCreatureName(itemEx.uid):lower() .. ' into the fish bowl.')
                        doRemoveCreature(itemEx.uid)
                    else
                        doSendMagicEffect(toPosition, CONST_ME_GROUNDSHAKER)
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You failed at capturing monster.')
                        doRemoveCreature(itemEx.uid)
                    end
                    doRemoveItem(item.uid)
                else
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You can\'t catch two monsters into same bottle.')
                end
            else
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Creature do not have require low health.')
            end
        else
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You can use it only on specific monsters.')
        end
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You can use it only on monsters.')
    end
    return true
end

original release script:
Code:
local storage = 56487

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local desc = getItemAttribute(item.uid, 'description') == nil and getItemInfo(item.itemid).description or getItemAttribute(item.uid, 'description')

    if not isCreature(itemEx.uid) then
        if getCreatureStorage(cid, storageLol) < os.time() then
            if string.find(desc:lower(), 'catched monster:') ~= nil then
                local x, y = string.find(desc, ': %a+.')
                local a, b = string.find(desc, ': %a+ %a+.')
               
                if a ~= nil then
                    if #getCreatureSummons(cid) == 0 then
                        doSummonMonster(cid, string.sub(desc, a + 2, b - 1))
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You summoned a monster.')
                    else
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You\'ve already summoned a monster.')
                    end
                elseif x ~= nil then
                    if #getCreatureSummons(cid) == 0 then
                        doSummonMonster(cid, string.sub(desc, x + 2, y - 1))
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You summoned a monster.')
                    else
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You\'ve already summoned a monster.')
                    end
                else
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Unknown monster.')
                end
            else
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You didn\'t catch anything into the bottle.')
            end
        else
            doPlayerSendCancel(cid, 'You need to wait before summoning it again.')
        end
    elseif itemEx.uid == cid then
        if #getCreatureSummons(cid) > 0 then
            if string.find(desc:lower(), 'catched monster:') ~= nil then
                local x, y = string.find(desc, ': %a+.')
                local a, b = string.find(desc, ': %a+ %a+.')
               
                if a ~= nil then
                    for k, v in pairs(getCreatureSummons(cid)) do
                        if getCreatureName(v):lower() == string.sub(desc, a + 2, b - 1) then
                            doRemoveCreature(v)
                            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Your monster is back to the bottle.')
                            break
                        end
                    end       
                elseif x ~= nil then
                    for k, v in pairs(getCreatureSummons(cid)) do
                        if getCreatureName(v):lower() == string.sub(desc, x + 2, y - 1) then
                            doRemoveCreature(v)
                            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Your monster is back to the bottle.')
                            break
                        end
                    end               
                else
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Unknown monster.')
                end
            else
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You didn\'t catch anything into the bottle.')
            end
        else
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You didn\'t summon anything.')
        end
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You can summon a catched monster if you use it on a tile or on ur self if you want to summon it back to the bottle.')
    end
    return true
end
 
Last edited:
I think you did something starnge here, cuz it's asking for a strange npc script loacted:
data/npc/268454640.xml

What else than the script you posted did you edit for this to work?
Please post them aswell, original and changes

You can /m these with ur gm?:
Code:
['troll'] 
['frost giant'] 
['zombie']
['mother'] 
['evil Eye'] 
['exodius'] 
['amirs bodyguard'] 
['paradise master']
 
i havent changed anything else, those arent the monsters i have, i have the original fishing monsters in there instead, and i can /m the fishing monsters


EDIT: i just edited the scripts above, they work and are just summoning the fishing monsters. its the line, doSummonMonster(cid, etc.)
when you changed it to doSummonCreature(cid, etc.) it created that NPC error
 
Last edited:
i havent changed anything else, those arent the monsters i have, i have the original fishing monsters in there instead, and i can /m the fishing monsters


EDIT: i just edited the scripts above, they work and are just summoning the fishing monsters. its the line, doSummonMonster(cid, etc.)
when you changed it to doSummonCreature(cid, etc.) it created that NPC error
You say u haven't changed anything, but the script you posted isn't what you're using? xd
 
Swiff i feel that i have been very clear on what the problem is.

the first time i posted about this and you tried to fix it, all you did was change this line:
Code:
doSummonMonster(cid, string.sub(desc, a + 2, b - 1))

to this line:
Code:
doSummonCreature(cid, string.sub(desc, a + 2, b - 1))

okay after you did this i tested it and all it did was create the NPC Error when i tried to release the monster:
Code:
[16:22:51.290] [Error - Action Interface]
[16:22:51.290] data/actions/scripts/AOD/release2.lua:onUse
[16:22:51.291] Description:
[16:22:51.291] (luaDoCreateMonster) Monster with name '268454640' not found
I/O warning : failed to load external entity "data/npc/268454640.xml"
[16:22:51.293] [Warning - Npc::loadFromXml] Cannot load npc file (data/npc/268454640.xml).
[16:22:51.293] Info: failed to load external entity "data/npc/268454640.xml"

you then proceeded to tell me that i changed something else and this error was my fault....when in fact your attempt at fixing it caused the error.



the two scripts above are the catch and release scripts. IM CURRENTLY USING THESE SCRIPTS AND THEY WORK AS THEY ARE SUPPOSED TO. they capture and then release a monster as a summon, all i want is the monster to SIMPLY BE SPAWNED NOT SUMMONED. i want the monster to attack everyone, not whoever the summoner is targetting. it can't be that hard, i just cant figure it out.
HERE ARE THE TWO SCRIPTS FOR THE THIRD TIME.

capture:
Code:
local t = {
    percent = 40,
    monsters = {
        ['wyrm'] = 75,
        ['sea serpent'] = 75,
        ['quara constrictor'] = 70,
        ['quara hydromancer'] = 60,
        ['quara mantassin'] = 40,
        ['quara pincher'] = 40,
        ['quara predator'] = 20,
        ['massive water elemental'] = 10,
    }
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local desc = getItemAttribute(item.uid, 'description') == nil and getItemInfo(item.itemid).description or getItemAttribute(item.uid, 'description')
  
    if isMonster(itemEx.uid) then
        if t.monsters[getCreatureName(itemEx.uid):lower()] then
            if getCreatureHealth(itemEx.uid) <= getCreatureMaxHealth(itemEx.uid) * t.percent / 100 then
                local desc = getItemAttribute(item.uid, 'description') == nil and getItemInfo(item.itemid).description or getItemAttribute(item.uid, 'description')
                if string.find(desc:lower(), 'catched monster:') == nil then
                    if math.random(1, 100) < t.monsters[getCreatureName(itemEx.uid):lower()] then
                        doSendMagicEffect(toPosition, CONST_ME_YALAHARIGHOST)
                      
                        local newItem = doPlayerAddItem(cid, 5929, 1)
                        doItemSetAttribute(newItem, 'description', desc .. ' Catched monster: ' .. getCreatureName(itemEx.uid):lower() .. '. ' .. getCreatureName(cid) .. ' has catched this monster.')
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You successfuly catched ' .. getCreatureName(itemEx.uid):lower() .. ' into the fish bowl.')
                        doRemoveCreature(itemEx.uid)
                    else
                        doSendMagicEffect(toPosition, CONST_ME_GROUNDSHAKER)
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You failed at capturing monster.')
                        doRemoveCreature(itemEx.uid)
                    end
                    doRemoveItem(item.uid)
                else
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You can\'t catch two monsters into same bottle.')
                end
            else
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Creature do not have require low health.')
            end
        else
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You can use it only on specific monsters.')
        end
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You can use it only on monsters.')
    end
    return true
end


Release:
Code:
local storage = 56487

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local desc = getItemAttribute(item.uid, 'description') == nil and getItemInfo(item.itemid).description or getItemAttribute(item.uid, 'description')

    if not isCreature(itemEx.uid) then
        if getCreatureStorage(cid, storageLol) < os.time() then
            if string.find(desc:lower(), 'catched monster:') ~= nil then
                local x, y = string.find(desc, ': %a+.')
                local a, b = string.find(desc, ': %a+ %a+.')
              
                if a ~= nil then
                    if #getCreatureSummons(cid) == 0 then
                        doSummonCreature(string.sub(desc, a + 2, b - 1), getThingPos(cid))
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You summoned a monster.')
                    else
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You\'ve already summoned a monster.')
                    end
                elseif x ~= nil then
                    if #getCreatureSummons(cid) == 0 then
                        doSummonCreature(string.sub(desc, a + 2, b - 1), getThingPos(cid))
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You summoned a monster.')
                    else
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You\'ve already summoned a monster.')
                    end
                else
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Unknown monster.')
                end
            else
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You didn\'t catch anything into the bottle.')
            end
        else
            doPlayerSendCancel(cid, 'You need to wait before summoning it again.')
        end
    elseif itemEx.uid == cid then
        if #getCreatureSummons(cid) > 0 then
            if string.find(desc:lower(), 'catched monster:') ~= nil then
                local x, y = string.find(desc, ': %a+.')
                local a, b = string.find(desc, ': %a+ %a+.')
              
                if a ~= nil then
                    for k, v in pairs(getCreatureSummons(cid)) do
                        if getCreatureName(v):lower() == string.sub(desc, a + 2, b - 1) then
                            doRemoveCreature(v)
                            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Your monster is back to the bottle.')
                            break
                        end
                    end      
                elseif x ~= nil then
                    for k, v in pairs(getCreatureSummons(cid)) do
                        if getCreatureName(v):lower() == string.sub(desc, x + 2, y - 1) then
                            doRemoveCreature(v)
                            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Your monster is back to the bottle.')
                            break
                        end
                    end              
                else
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Unknown monster.')
                end
            else
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You didn\'t catch anything into the bottle.')
            end
        else
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You didn\'t summon anything.')
        end
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You can summon a catched monster if you use it on a tile or on ur self if you want to summon it back to the bottle.')
    end
    return true
end
 
Sorry I misundersttod you then, I thought you said
"I havent changed anything else, those arent the monsters I have".

Anyhow, I am trying to find where it says it's a player summon, but I can't find it. tracked it so far:
Code:
f string.find(desc:lower(), 'catched monster:') ~= nil then
local x, y = string.find(desc, ': %a+.')
local a, b = string.find(desc, ': %a+ %a+.')

if a ~= nil then
if #getCreatureSummons(cid) == 0 then
doSummonMonster(cid, string.sub(desc, a + 2, b - 1))
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You summoned a monster.')
doRemoveItem(item.uid, 1)
I would really like to think that it'd be here, but I have never paid attention to string.find or string.sub before. I also don't know that this "#" means before "getCreatureSummons"
I think that those string only collect the name of the monster.. But ye, I've looked through it few times now and I can't find what defines the monster to be a player summon.
I guess # can just mean "number" equals 0 here, but 0 also stands for false so not sure..
I would also liek to think that this line
Code:
 doSummonMonster(cid, string.sub(desc, a + 2, b - 1))
have the code to make it a players. But I'm lost. Sorry

Edit:
I just googled them, and it doesen't seem that they are defining if the monster is owned or not.

Did you try to use the edit I made from start. In other words, catch and release
And did you try to catch, then edit script and then release?

To summon wild monsters I use
Code:
doSummonCreature
To summon an owned monster I use
Code:
doSummonMonster
So. That's really the only thing I can figure out..
I've been at this for an hour now, and I also don't understand the timer storage "Lo1". Local 1? "56487". Ok, so this is seconds or. meh:SYeah I will stop looking at this now, only make me dizzy :/
 
Sorry if i sounded rude last post, this script is frustrating me too >.< but Yea i have no idea what to do. changing it from summonmonster to summoncreature just makes that NPC error. :/ idk what to do. does anyone else know?
 
Making scripts shorter, lowering their size is admin's main priority.

Little part:
Code:
                local text = ""       
                if [...]

                else
                    text = "You can\'t catch two monsters into same bottle."
                end
            else
                text = "Creature do not have require low health."
            end
        else
            text = "You can use it only on specific monsters."
        end
    else
        text = "You can use it only on monsters."
    end
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, text)
    return true
end
 
Back
Top