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

Fish bowl

ToloXXX

New Member
Joined
Dec 14, 2014
Messages
93
Reaction score
4
anyone have script to use a bowl and catch fish monsters and then release it where ever you want. using 0.3.6
 
this belongs in requests since you're asking for a script, not one that needs fixing
Code:
local fish = {'Quara Mantassin'}
local str = 'This key holds the soul of a '

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local desc = getItemAttribute(item.uid, 'description')
    local summon = string.sub(desc, string.len(str))
    local creature = itemEx.uid
    local name = isMonster(creature) and getCreatureName(creature)
    -- Disallows use in protection zones
    if getTilePzInfo(fromPosition) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, 'You may not use this in a protection zone.')
        return true
    end
    -- If the key string is in the description, it will summon the monster
    if string.match(desc, str) then
        doSummonCreature(summon, getClosestFreeTile(cid, fromPosition, true))
        doItemSetAttribute(item.uid, 'description', '')
    end
    -- If itemEx is a creature and its name is in the array, then it will remove and set description
    if name and isInArray(fish, name) then
        doItemSetAttribute(item.uid, 'description', str .. name)
        doRemoveCreature(creature)
    end
    return true
end
i put 'this key' but you can obviously change it to fish bowl or whatever you like
this is just an example script of how to do it, you can add effects, animated text or whatever you want to it
 
this belongs in requests since you're asking for a script, not one that needs fixing
Code:
local fish = {'Quara Mantassin'}
local str = 'This key holds the soul of a '

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local desc = getItemAttribute(item.uid, 'description')
    local summon = string.sub(desc, string.len(str))
    local creature = itemEx.uid
    local name = isMonster(creature) and getCreatureName(creature)
    -- Disallows use in protection zones
    if getTilePzInfo(fromPosition) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, 'You may not use this in a protection zone.')
        return true
    end
    -- If the key string is in the description, it will summon the monster
    if string.match(desc, str) then
        doSummonCreature(summon, getClosestFreeTile(cid, fromPosition, true))
        doItemSetAttribute(item.uid, 'description', '')
    end
    -- If itemEx is a creature and its name is in the array, then it will remove and set description
    if name and isInArray(fish, name) then
        doItemSetAttribute(item.uid, 'description', str .. name)
        doRemoveCreature(creature)
    end
    return true
end
i put 'this key' but you can obviously change it to fish bowl or whatever you like
this is just an example script of how to do it, you can add effects, animated text or whatever you want to it




thanks mate!
 
this belongs in requests since you're asking for a script, not one that needs fixing
Code:
local fish = {'Quara Mantassin'}
local str = 'This key holds the soul of a '

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local desc = getItemAttribute(item.uid, 'description')
    local summon = string.sub(desc, string.len(str))
    local creature = itemEx.uid
    local name = isMonster(creature) and getCreatureName(creature)
    -- Disallows use in protection zones
    if getTilePzInfo(fromPosition) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, 'You may not use this in a protection zone.')
        return true
    end
    -- If the key string is in the description, it will summon the monster
    if string.match(desc, str) then
        doSummonCreature(summon, getClosestFreeTile(cid, fromPosition, true))
        doItemSetAttribute(item.uid, 'description', '')
    end
    -- If itemEx is a creature and its name is in the array, then it will remove and set description
    if name and isInArray(fish, name) then
        doItemSetAttribute(item.uid, 'description', str .. name)
        doRemoveCreature(creature)
    end
    return true
end
i put 'this key' but you can obviously change it to fish bowl or whatever you like
this is just an example script of how to do it, you can add effects, animated text or whatever you want to it


getting this error:

[31/10/2016 09:55:54] [Error - Action Interface]
[31/10/2016 09:55:54] data/actions/scripts/tools/bowl.lua:eek:nUse
[31/10/2016 09:55:54] Description:
[31/10/2016 09:55:54] data/actions/scripts/tools/bowl.lua:6: bad argument #1 to 'sub' (string expected, got nil)
[31/10/2016 09:55:54] stack traceback:
[31/10/2016 09:55:54] [C]: in function 'sub'
[31/10/2016 09:55:54] data/actions/scripts/tools/bowl.lua:6: in function <data/actions/scripts/tools/bowl.lua:4>
 
getting this error:

[31/10/2016 09:55:54] [Error - Action Interface]
[31/10/2016 09:55:54] data/actions/scripts/tools/bowl.lua:eek:nUse
[31/10/2016 09:55:54] Description:
[31/10/2016 09:55:54] data/actions/scripts/tools/bowl.lua:6: bad argument #1 to 'sub' (string expected, got nil)
[31/10/2016 09:55:54] stack traceback:
[31/10/2016 09:55:54] [C]: in function 'sub'
[31/10/2016 09:55:54] data/actions/scripts/tools/bowl.lua:6: in function <data/actions/scripts/tools/bowl.lua:4>
o_O
add print(desc) before local sub
it should be getting description of the item 0.0
might be a 0.4 function
 
still gives me the error probably missing function
is it the same sub error?
does it not print anything?
does it say attempt to call global doItemGetAttribute?

edit: if it does say attempt to call global: consider upgrading to 0.4
https://otland.net/threads/8-60-the-forgotten-server-0-4.240240/
it's pretty much the same as 0.3.6, except the times for globalevents and shit are in milliseconds instead of seconds
+ it has more functions
 
is it the same sub error?
does it not print anything?
does it say attempt to call global doItemGetAttribute?

edit: if it does say attempt to call global: consider upgrading to 0.4
https://otland.net/threads/8-60-the-forgotten-server-0-4.240240/
it's pretty much the same as 0.3.6, except the times for globalevents and shit are in milliseconds instead of seconds
+ it has more functions

no not the global, its just the sub error trying to use the bowl doesnt do anthing, and when you hit click on the the bowl says use suppose to say use with
 
Back
Top