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

Error script.lua

TopllDan

Football <3
Joined
May 14, 2015
Messages
66
Reaction score
0
Hello I am with this error when I go to look and when I try to put it out of pokemon ball Note: the pokemon I'm trying to put it out was captured at once there give error in goback

error
Code:
[04/06/2015 15:28:08] [Error - CreatureScript Interface] 
[04/06/2015 15:28:08] data/creaturescripts/scripts/look.lua:onLook
[04/06/2015 15:28:08] Description: 
[04/06/2015 15:28:08] data/creaturescripts/scripts/look.lua:43: bad argument #1 to 'floor' (number expected, got nil)
[04/06/2015 15:28:08] stack traceback:
[04/06/2015 15:28:08]  [C]: in function 'floor'
[04/06/2015 15:28:08]  data/creaturescripts/scripts/look.lua:43: in function <data/creaturescripts/scripts/look.lua:1>

Look.lua
Code:
function onLook(cid, thing, position, lookDistance)

    local str = ""

    if not isCreature(thing.uid) then

        local iname = getItemInfo(thing.itemid)

        if isPokeball(thing.itemid) then

            local unique = getItemAttribute(thing.uid, "unique")  --alterado v2.6

            local pokename = getItemAttribute(thing.uid, "poke")
            local item = getItemInfo(thing.itemid)
            str = "You see "..item.article.." "..item.name.."." --alterado v2.6
            if unique and unique == getCreatureName(cid) then
              str = str.." It's an unique item."   --alterado v2.6
            end
            str = str.."\nIt contains "..getArticle(pokename).." "..pokename.." [level "..getItemAttribute(thing.uid, "level").."].\n" --alterado v2.6

            --alterado v2.6 
               
            local boost = getItemAttribute(thing.uid, "boost") or 0
            local boostshow = ""

            if boost > 0 then
                str = str.."Boost level: +"..boost..".\n"
            end

            if getItemAttribute(thing.uid, "nick") then
                str = str.."It's nickname is: "..getItemAttribute(thing.uid, "nick")..".\n"
            end
       
            if getItemAttribute(thing.uid, "gender") == SEX_MALE then
                str = str.."It is male."
            elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then
                str = str.."It is female."
            else
                str = str.."It is genderless."
            end
   
            str = str.."\n--- Status ---"
            str = str.."\nOffense: "..math.floor(getItemAttribute(thing.uid, "offense")).." Defense: "..math.floor(getItemAttribute(thing.uid, "defense")).."\n"
            str = str.."Agility: "..math.floor(getItemAttribute(thing.uid, "speed")).." Sp. Attack: "..math.floor(getItemAttribute(thing.uid, "specialattack")).."\n"
            str = str.."Vitality: "..math.floor(getItemAttribute(thing.uid, "vitality"))..""   

        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)

        return false

        elseif string.find(iname.name, "fainted") or string.find(iname.name, "defeated") then

            str = "You see a "..string.lower(iname.name).." ["..getItemAttribute(thing.uid, "level").."].\n"

            if getItemAttribute(thing.uid, "gender") == SEX_MALE then
                str = str.."It is male."
            elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then
                str = str.."It is female."
            else
                str = str.."It is genderless."
            end
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)

        return false

        else

        return true

        end
    end

local NPCBattle = {
["Brock"] = {artig = "He is", cidbat = "Pewter"},
["Misty"] = {artig = "She is", cidbat = "Cerulean"}, 
}  
                                                       --edited npc name
NPCname = {"Brock", "Misty"}

local npcname = getCreatureName(thing.uid)
if not isPlayer(thing.uid) and not isMonster(thing.uid) and isInArray(NPCname, npcname) then
   str = "You see "..npcname..". "..NPCBattle[npcname].artig.." a pokemon trainer from "..NPCBattle[npcname].cidbat.."."
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
   return false
end

if not isPlayer(thing.uid) and not isMonster(thing.uid) then    
   str = "You see "..getCreatureName(thing.uid).."."
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
   return false
end

look = {
[1] = {"a Volcanic Spark", "a Volcanic Flame","a Volcanic Firetamer","a Volcanic Pyromancer","a Volcanic Master"},
[2] = {"a Seavell Drop", "a Seavell Icelake","a Seavell Waterfall","a Seavell Frost","a Seavell Master"},
[3] = {"an Orebound Sand", "an Orebound Rock","an Orebound Solid","an Orebound Hardskin","an Orebound Hero"},
[4] = {"a Wingeon Cloud", "a Wingeon Wind","a Wingeon Sky","a Wingeon Falcon","a Wingeon Dragon"},
[5] = {"a Malefic Troublemaker", "a Malefic Venomancer","a Malefic Spectre","a Malefic Nightwalker","a Malefic Master"},
[6] = {"a Gardestrike Fist", "a Gardestrike Tamer","a Gardestrike Fighter","a Gardestrike DeathHand","a Gardestrike Champion"},
[7] = {"a Psycraft Mind", "a Psycraft Brain","a Psycraft Scholar","a Psycraft Telepath","a Psycraft Medium"},
[8] = {"a Naturia Seed", "a Naturia Sprout","a Naturia Webhead","a Naturia Woodtrunk","a Naturia Keeper"},
[9] = {"a Raibolt Shock", "a Raibolt Watt","a Raibolt Electrician","a Raibolt Overcharged","a Raibolt Legend"},
}

youAre = {
[3] = "a Senior Tutor",
[4] = "a Game Master",
[5] = "a Sub",                     --alterado v2.3
[6] = "a GOD"
}

if thing.uid == cid then
     
   if getPlayerStorageValue(thing.uid, 86228) <= 0 then
      if getPlayerGroupId(thing.uid) >= 3 and getPlayerGroupId(thing.uid) <= 6 then    --alterado v2.3
          pos = getCreaturePosition(thing.uid)
          ocupacao = youAre[getPlayerGroupId(thing.uid)]          --alterado v2.3
          str = "You see yourself. You are "..ocupacao..".\n"
          str = str.."Pos: {x = "..pos.x..", y = "..pos.y..", z = "..pos.z.."}."
      else
          str = "You see yourself. You are a Pokemon Trainer."
      end
     
   else
      vocation = getPlayerStorageValue(thing.uid, 86228)
      rank = getPlayerStorageValue(thing.uid, 862281)
      promote = look[vocation][rank]   
      if getPlayerGroupId(thing.uid) >= 3 and getPlayerGroupId(thing.uid) <= 6 then
          pos = getCreaturePosition(thing.uid)
          ocupacao = youAre[getPlayerGroupId(thing.uid)]          --alterado v2.3
          str = "You see yourself. You are "..ocupacao.." and "..promote..".\n"
          str = str.."Pos: {x = "..pos.x..", y = "..pos.y..", z = "..pos.z.."}."
      else
          str = "You see yourself. You are "..promote.."."
      end
   end
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)

return false
end   
                                                                    --edited clan system


if isPlayer(thing.uid) and thing.uid ~= cid then

   vocation2 = getPlayerStorageValue(thing.uid, 86228) 
   rank2 = getPlayerStorageValue(thing.uid, 862281)

   if getPlayerStorageValue(thing.uid, 86228) <= 0 then
      promote2 = "a Pokemon Trainer"
   else
      promote2 = look[vocation2][rank2]
   end

   if getPlayerSex(thing.uid) == 1 then
      artic = "He is"           
   elseif getPlayerSex(thing.uid) == 0 then
      artic = "She is"
   end   
   
   if getPlayerGroupId(thing.uid) >= 3 and getPlayerGroupId(thing.uid) <= 6 then   --alterado v2.3
       pos = getCreaturePosition(thing.uid)
       ocupacao = youAre[getPlayerGroupId(thing.uid)]          --alterado v2.3
       str = "You see "..getCreatureName(thing.uid)..". "..artic.." "..ocupacao.." and "..promote2..".\n"
       str = str.."Poss: {x = "..pos.x..", y = "..pos.y..", z = "..pos.z.."}."
   else
       str = "You see "..getCreatureName(thing.uid)..". "..artic.." "..promote2.."."
   end
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
               
return false
end

    if getCreatureName(thing.uid) == "Evolution" then return false end

    if not isSummon(thing.uid) then
        local str = "You see a wild "..string.lower(getCreatureName(thing.uid)).." [level "..getPokemonLevel(thing.uid).."].\n"
        if getPokemonGender(thing.uid)  == SEX_MALE then
            str = str.."It is male."
        elseif getPokemonGender(thing.uid)  == SEX_FEMALE then
            str = str.."It is female."
        else
            str = str.."It is genderless."
        end
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
    return false
    elseif isSummon(thing.uid) and not isPlayer(thing.uid) then

        local boostlevel = getItemAttribute(getPlayerSlotItem(getCreatureMaster(thing.uid), 8).uid, "boost") or 0
        local boostshow = " + "..boostlevel.."]"

        if showBoostSeparated then
            boostshow = "] [+"..boostlevel.."]"
        end

        local levelinfo = "["..getPokemonLevel(thing.uid)..""..boostshow..""

        if getCreatureMaster(thing.uid) == cid then
            local myball = getPlayerSlotItem(cid, 8).uid
            local nexp = getItemAttribute(myball, "nextlevelexp")

            local string = "You see your "..string.lower(getCreatureName(thing.uid)).." "..levelinfo.."."
            string = string.."\nHit points: "..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid).."."
            string = string.."\n"..getPokemonHappinessDescription(thing.uid)
                if getItemAttribute(myball, "level") <= 99 then
                    string = string.."\nExperience needed to level up: "..nexp.."."
                end
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, string)
        else
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..string.lower(getCreatureName(thing.uid)).." "..levelinfo..".\nIt belongs to "..getCreatureName(getCreatureMaster(thing.uid))..".")
        end


    return false
    end

return true
end
 
Last edited:
with the changes you had to make
Link >> http://pastebin.com/svPjh1Ed

Code:
print(getArticle(pokename))
print(pokename)
print(getItemAttribute(thing.uid, "level"))

To
Code:
print(getArticle(pokename))
print(pokename)
print(getItemAttribute(thing.uid, "level"))
str = str.."\nIt contains "..getArticle(pokename).." "..pokename.." [level "..getItemAttribute(thing.uid, "level").."].\n" --alterado v2.6

Then say what line the error is on.
 
Code:
print(getArticle(pokename))
print(pokename)
print(getItemAttribute(thing.uid, "level"))

To
Code:
print(getArticle(pokename))
print(pokename)
print(getItemAttribute(thing.uid, "level"))
str = str.."\nIt contains "..getArticle(pokename).." "..pokename.." [level "..getItemAttribute(thing.uid, "level").."].\n" --alterado v2.6

Then say what line the error is on.
thereby?
Code:
local item = getItemInfo(thing.itemid)
str = "You see "..item.article.." "..item.name.."." --alterado v2.6
if unique and unique == getCreatureName(cid) then
    str = str.." It's an unique item."   --alterado v2.6
end
print(getArticle(pokename))
print(pokename)
print(getItemAttribute(thing.uid, "level"))
str = str.."\nIt contains "..getArticle(pokename).." "..pokename.." [level "..getItemAttribute(thing.uid, "level").."].\n" --alterado v2.6
 
I did it and it happened this error
Code:
[20/05/2015 16:58:23] [Error - CreatureScript Interface] 
[20/05/2015 16:58:23] data/creaturescripts/scripts/look.lua:onLook
[20/05/2015 16:58:23] Description: 
[20/05/2015 16:58:23] data/creaturescripts/scripts/look.lua:26: attempt to concatenate a nil value
[20/05/2015 16:58:23] stack traceback:
[20/05/2015 16:58:23]     data/creaturescripts/scripts/look.lua:26: in function <data/creaturescripts/scripts/look.lua:1>
 
To me it looks like the argument 'thing' is nil, try printing it and post the output.

Add this to the beginning:
Code:
function onLook(cid, thing, position, lookDistance)
    print(thing)
    for k,v in pairs(thing) do
        print(k)
        print(v)
    end
 
And what is now on line 26?
Never said it would work, it was to make it easier to see what the problem was.
Maybe Anti is right that it's the thing argument.
 
To me it looks like the argument 'thing' is nil, try printing it and post the output.

Add this to the beginning:
Code:
function onLook(cid, thing, position, lookDistance)
    print(thing)
    for k,v in pairs(thing) do
        print(k)
        print(v)
    end
And what is now on line 26?
Never said it would work, it was to make it easier to see what the problem was.
Maybe Anti is right that it's the thing argument.

I added at the beginning and gave this error'
Code:
[21/05/2015 14:33:53] actionid
[21/05/2015 14:33:53] 0
[21/05/2015 14:33:53] uid
[21/05/2015 14:33:53] 70030
[21/05/2015 14:33:53] itemid
[21/05/2015 14:33:53] 11829
[21/05/2015 14:33:53] type
[21/05/2015 14:33:53] 0
[21/05/2015 14:33:53] a
[21/05/2015 14:33:53] Rattata


[21/05/2015 14:33:53] [Error - CreatureScript Interface] 
[21/05/2015 14:33:53] data/creaturescripts/scripts/look.lua:onLook
[21/05/2015 14:33:53] Description: 
[21/05/2015 14:33:53] data/creaturescripts/scripts/look.lua:31: attempt to concatenate a nil value
[21/05/2015 14:33:53] stack traceback:
[21/05/2015 14:33:53]     data/creaturescripts/scripts/look.lua:31: in function <data/creaturescripts/scripts/look.lua:1>

leaving the so look.lua > http://pastebin.com/jSJhW3xX
 
I added at the beginning and gave this error'
Code:
[21/05/2015 14:33:53] actionid
[21/05/2015 14:33:53] 0
[21/05/2015 14:33:53] uid
[21/05/2015 14:33:53] 70030
[21/05/2015 14:33:53] itemid
[21/05/2015 14:33:53] 11829
[21/05/2015 14:33:53] type
[21/05/2015 14:33:53] 0
[21/05/2015 14:33:53] a
[21/05/2015 14:33:53] Rattata


[21/05/2015 14:33:53] [Error - CreatureScript Interface]
[21/05/2015 14:33:53] data/creaturescripts/scripts/look.lua:onLook
[21/05/2015 14:33:53] Description:
[21/05/2015 14:33:53] data/creaturescripts/scripts/look.lua:31: attempt to concatenate a nil value
[21/05/2015 14:33:53] stack traceback:
[21/05/2015 14:33:53]     data/creaturescripts/scripts/look.lua:31: in function <data/creaturescripts/scripts/look.lua:1>

leaving the so look.lua > http://pastebin.com/jSJhW3xX

But that isen't even what I sent you, https://otland.net/threads/error-script-lua.232487/#post-2241263

And add this aswell, https://otland.net/threads/error-script-lua.232487/page-2#post-2242301
With that we can't really see what the problem is, since nothing is writing out nil.
 
Code:
function onLook(cid, thing, position, lookDistance)
    local str = ""
    if not isCreature(thing.uid) then
        local iname = getItemInfo(thing.itemid)
        if isPokeball(thing.itemid) then
            local unique = getItemAttribute(thing.uid, "unique") --alterado v2.6
            local pokename = getItemAttribute(thing.uid, "poke")
            local item = getItemInfo(thing.itemid)
            str = "You see "..item.article.." "..item.name.."." --alterado v2.6
            if unique and unique == getCreatureName(cid) then
                str = str.." It's an unique item."    --alterado v2.6
            end

            print(getArticle(pokename))
            print(pokename)
            print(getItemAttribute(thing.uid, "level"))

            str = str.."\nIt contains "..getArticle(thing.uid).." "..pokename.." [level "..getItemAttribute(thing.uid, "level").."].\n" --alterado v2.6

            --alterado v2.6 
            local boost = getItemAttribute(thing.uid, "boost") or 0
            local boostshow = ""

            if boost > 0 then
                str = str.."Boost level: +"..boost..".\n"
            end

            if getItemAttribute(thing.uid, "nick") then
                str = str.."It's nickname is: "..getItemAttribute(thing.uid, "nick")..".\n"
            end

            if getItemAttribute(thing.uid, "gender") == SEX_MALE then
                str = str.."It is male."
            elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then
                str = str.."It is female."
            else
                str = str.."It is genderless."
            end

            str = str.."\n--- Status ---"
            str = str.."\nOffense: "..math.floor(getItemAttribute(thing.uid, "offense")).." Defense: "..math.floor(getItemAttribute(thing.uid, "defense")).."\n"
            str = str.."Agility: "..math.floor(getItemAttribute(thing.uid, "speed")).." Sp. Attack: "..math.floor(getItemAttribute(thing.uid, "specialattack")).."\n"
            str = str.."Vitality: "..math.floor(getItemAttribute(thing.uid, "vitality")).."" 
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
            return false
        elseif string.find(iname.name, "fainted") or string.find(iname.name, "defeated") then
            str = "You see a "..string.lower(iname.name).." ["..getItemAttribute(thing.uid, "level").."].\n"
            if getItemAttribute(thing.uid, "gender") == SEX_MALE then
                str = str.."It is male."
            elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then
                str = str.."It is female."
            else
                str = str.."It is genderless."
            end
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
            return false
        end
        return true
    end

    local NPCBattle = {
        ["Brock"] = {artig = "He is", cidbat = "Pewter"},
        ["Misty"] = {artig = "She is", cidbat = "Cerulean"}, 
    }

    --edited npc name
    NPCname = {"Brock", "Misty"}

    local npcname = getCreatureName(thing.uid)
    if not isPlayer(thing.uid) and not isMonster(thing.uid) and isInArray(NPCname, npcname) then
        str = "You see "..npcname..". "..NPCBattle[npcname].artig.." a pokemon trainer from "..NPCBattle[npcname].cidbat.."."
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
        return false
    end

    if not isPlayer(thing.uid) and not isMonster(thing.uid) then
        str = "You see "..getCreatureName(thing.uid).."."
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
        return false
    end

    look = {
        [1] = {"a Volcanic Spark", "a Volcanic Flame","a Volcanic Firetamer","a Volcanic Pyromancer","a Volcanic Master"},
        [2] = {"a Seavell Drop", "a Seavell Icelake","a Seavell Waterfall","a Seavell Frost","a Seavell Master"},
        [3] = {"an Orebound Sand", "an Orebound Rock","an Orebound Solid","an Orebound Hardskin","an Orebound Hero"},
        [4] = {"a Wingeon Cloud", "a Wingeon Wind","a Wingeon Sky","a Wingeon Falcon","a Wingeon Dragon"},
        [5] = {"a Malefic Troublemaker", "a Malefic Venomancer","a Malefic Spectre","a Malefic Nightwalker","a Malefic Master"},
        [6] = {"a Gardestrike Fist", "a Gardestrike Tamer","a Gardestrike Fighter","a Gardestrike DeathHand","a Gardestrike Champion"},
        [7] = {"a Psycraft Mind", "a Psycraft Brain","a Psycraft Scholar","a Psycraft Telepath","a Psycraft Medium"},
        [8] = {"a Naturia Seed", "a Naturia Sprout","a Naturia Webhead","a Naturia Woodtrunk","a Naturia Keeper"},
        [9] = {"a Raibolt Shock", "a Raibolt Watt","a Raibolt Electrician","a Raibolt Overcharged","a Raibolt Legend"}
    }

    youAre = {
        [3] = "a Senior Tutor",
        [4] = "a Game Master",
        [5] = "a Sub", --alterado v2.3
        [6] = "a GOD"
    }

    if thing.uid == cid then
        if getPlayerStorageValue(thing.uid, 86228) <= 0 then
            if getPlayerGroupId(thing.uid) >= 3 and getPlayerGroupId(thing.uid) <= 6 then --alterado v2.3
                pos = getCreaturePosition(thing.uid)
                ocupacao = youAre[getPlayerGroupId(thing.uid)] --alterado v2.3
                str = "You see yourself. You are "..ocupacao..".\n"
                str = str.."Pos: {x = "..pos.x..", y = "..pos.y..", z = "..pos.z.."}."
            else
                str = "You see yourself. You are a Pokemon Trainer."
            end
        else
            vocation = getPlayerStorageValue(thing.uid, 86228)
            rank = getPlayerStorageValue(thing.uid, 862281)
            promote = look[vocation][rank] 
            if getPlayerGroupId(thing.uid) >= 3 and getPlayerGroupId(thing.uid) <= 6 then
                pos = getCreaturePosition(thing.uid)
                ocupacao = youAre[getPlayerGroupId(thing.uid)] --alterado v2.3
                str = "You see yourself. You are "..ocupacao.." and "..promote..".\n"
                str = str.."Pos: {x = "..pos.x..", y = "..pos.y..", z = "..pos.z.."}."
            else
                str = "You see yourself. You are "..promote.."."
            end
        end
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
        return false
    end

    --edited clan system
    if isPlayer(thing.uid) and thing.uid ~= cid then
        vocation2 = getPlayerStorageValue(thing.uid, 86228)
        rank2 = getPlayerStorageValue(thing.uid, 862281)
        if getPlayerStorageValue(thing.uid, 86228) <= 0 then
            promote2 = "a Pokemon Trainer"
        else
            promote2 = look[vocation2][rank2]
        end

        if getPlayerSex(thing.uid) == 1 then
            artic = "He is" 
        elseif getPlayerSex(thing.uid) == 0 then
            artic = "She is"
        end 

        if getPlayerGroupId(thing.uid) >= 3 and getPlayerGroupId(thing.uid) <= 6 then    --alterado v2.3
            pos = getCreaturePosition(thing.uid)
            ocupacao = youAre[getPlayerGroupId(thing.uid)] --alterado v2.3
            str = "You see "..getCreatureName(thing.uid)..". "..artic.." "..ocupacao.." and "..promote2..".\n"
            str = str.."Poss: {x = "..pos.x..", y = "..pos.y..", z = "..pos.z.."}."
        else
            str = "You see "..getCreatureName(thing.uid)..". "..artic.." "..promote2.."."
        end
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
        return false
    end

    if getCreatureName(thing.uid) == "Evolution" then
        return false
    end

    if not isSummon(thing.uid) then
        local str = "You see a wild "..string.lower(getCreatureName(thing.uid)).." [level "..getPokemonLevel(thing.uid).."].\n"
        if getPokemonGender(thing.uid) == SEX_MALE then
            str = str.."It is male."
        elseif getPokemonGender(thing.uid) == SEX_FEMALE then
            str = str.."It is female."
        else
            str = str.."It is genderless."
        end
       
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
        return false
    elseif isSummon(thing.uid) and not isPlayer(thing.uid) then
        local boostlevel = getItemAttribute(getPlayerSlotItem(getCreatureMaster(thing.uid), 8).uid, "boost") or 0
        local boostshow = " + "..boostlevel.."]"
        if showBoostSeparated then
            boostshow = "] [+"..boostlevel.."]"
        end

        local levelinfo = "["..getPokemonLevel(thing.uid)..""..boostshow..""
        if getCreatureMaster(thing.uid) == cid then
            local myball = getPlayerSlotItem(cid, 8).uid
            local nexp = getItemAttribute(myball, "nextlevelexp")

            local string = "You see your "..string.lower(getCreatureName(thing.uid)).." "..levelinfo.."."
            string = string.."\nHit points: "..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid).."."
            string = string.."\n"..getPokemonHappinessDescription(thing.uid)
            if getItemAttribute(myball, "level") <= 99 then
                string = string.."\nExperience needed to level up: "..nexp.."."
            end
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, string)
        else
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..string.lower(getCreatureName(thing.uid)).." "..levelinfo..".\nIt belongs to "..getCreatureName(getCreatureMaster(thing.uid))..".")
        end
        return false
    end
    return true
end

Do not change the script anything, tell us what the error message is.
 
Do not change the script anything, tell us what the error message is.
Give this error here:
Code:
[21/05/2015 15:14:17] a
[21/05/2015 15:14:17] Rattata


[21/05/2015 15:14:17] [Error - CreatureScript Interface] 
[21/05/2015 15:14:17] data/creaturescripts/scripts/look.lua:onLook
[21/05/2015 15:14:17] Description: 
[21/05/2015 15:14:17] data/lib/050-function.lua:107: attempt to index local 'str' (a number value)
[21/05/2015 15:14:17] stack traceback:
[21/05/2015 15:14:17]     data/lib/050-function.lua:107: in function 'getArticle'
[21/05/2015 15:14:17]     data/creaturescripts/scripts/look.lua:18: in function <data/creaturescripts/scripts/look.lua:1>
 
Dafuq, post your 050-functions.lua
My guess is this:
Code:
getItemAttribute(thing.uid, "level")

Does your server have that attribute? And if it does what does it return?
Asking since it diden't print anything out, the getArticle() function seems to be bugged aswell.
 
Dafuq, post your 050-functions.lua
My guess is this:
Code:
getItemAttribute(thing.uid, "level")

Does your server have that attribute? And if it does what does it return?
Asking since it diden't print anything out, the getArticle() function seems to be bugged aswell.
I do not know what serves this function, as I said I downloaded this server and it has come with this role
my some function.lua: http://pastebin.com/z3nZgTwZ
 
I do not know what serves this function, as I said I downloaded this server and it has come with this role
my some function.lua: http://pastebin.com/z3nZgTwZ

getItemAttribute is located in your source code.
That isen't 050-functions.lua, it dosen't even have the getArticle() function.
 
so how can I add the source?

Use notepad++ to serach through the files, find the enums where the attributes are kept and see if you can find them.
And if you can't find it then idk how to fix it, since I don't even know what it should store, since the item already has a name attribute that you can use via getItemName(uid)?
 
Back
Top Bottom