Results 1 to 9 of 9

Thread: Whats wrong with that function? @Sirmate ;p

  1. #1
    iBot User
    Join Date
    May 2012
    Location
    Spain
    Posts
    213
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    15 Post(s)
    Reputation
    32
    Rep Power
    5

    Whats wrong with that function? @Sirmate ;p

    I wont paste all the code but the problem seems to be here
    13:57 : LUAoAction:GreatFireball-Script: - LuaInterface.LuaScriptException: [string "chunk"]:48: attempt to compare string with number
    PHP Code:
    local MONSTERS = {'Dragon Lord''Dragon Lord Hatchling'}
    local ULTIMATE = {WORDS "exevo gran mas frigo"AMOUNT 6DIST 6}
    local PVPCONFIG = {ENABLED trueSAFEDIST 8SAFELIST = {"NWA"}}

    table.lower(MONSTERS)
    table.lower(PVPCONFIG.SAFELIST)

    function 
    tableFind(elementtable)
        for 
    _,v in pairs(table) do
            if 
    == element then
                
    return true
            end
        end
        
    return false
    end

    function userDataToTable(userData)
        
    local t = {} 
        
    local it userData:GetEnumerator()
        while 
    it:MoveNext() do 
            
    t[#t+1] = it.Current 
            
    end 
        
    return 
    end

    function havePlayer()
        if 
    PVPCONFIG.ENABLED then
            local PLAYERTABLE 
    userDataToTable(getcreatures("ps"))
            for 
    INDEXPLAYER in ipairs(PLAYERTABLE) do
                if 
    PLAYER.dist <= PVPCONFIG.SAFEDIST and not tableFind(string.lower(PLAYER.name), PVPCONFIG.SAFELISTthen
                    
    return true
                end
            end
        end
        
    return false
    end

    local CREATURETABLE 
    userDataToTable(getcreatures("ms"))
    local ULTIMATECOUNT 0

    for INDEXMONSTER in pairs(CREATURETABLE) do
        if 
    tableFind(string.lower(MONSTER.name), MONSTERS) and MONSTER.dist <= ULTIMATE.DIST then
            ULTIMATECOUNT 
    ULTIMATECOUNT 1
        end
    end 
    thanks in advance,..

    Regards, NWA
    Last edited by NWA; 02-22-2013 at 11:40 AM.
    Regards, NWA

  2. #2
    Normal User RafiXWPT's Avatar
    Join Date
    Jun 2012
    Location
    (Poland) http://rafixwptscripts.com
    Posts
    1,602
    Mentioned
    31 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    128 Post(s)
    Reputation
    128
    Rep Power
    9
    its not that action, error is in line 48, that action is too short xd, show us all action

  3. #3
    iBot User
    Join Date
    May 2012
    Location
    Spain
    Posts
    213
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    15 Post(s)
    Reputation
    32
    Rep Power
    5
    Quote Originally Posted by RafiXWPT View Post
    its not that action, error is in line 48, that action is too short xd, show us all action
    yes i know but this is the part of line 48, thats why I pasted, because I think is something to do with that string... if tableFind(string.lower(MONSTER.name), I think its not necesary to paste full action because the others are only setup

    Regards,
    Regards, NWA

  4. #4
    Normal User RafiXWPT's Avatar
    Join Date
    Jun 2012
    Location
    (Poland) http://rafixwptscripts.com
    Posts
    1,602
    Mentioned
    31 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    128 Post(s)
    Reputation
    128
    Rep Power
    9
    u have there: MONSTER.dist try change it to target.dist, check that

  5. #5
    iBot User
    Join Date
    May 2012
    Location
    Spain
    Posts
    213
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    15 Post(s)
    Reputation
    32
    Rep Power
    5
    yes but because the index, idk I hope sirmate read that because main code is from him, so Im sure he will know where is the problem :S
    Regards, NWA

  6. #6
    Normal User
    Join Date
    Jun 2012
    Location
    Sweden
    Posts
    1,671
    Mentioned
    18 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    8 Post(s)
    Reputation
    132
    Rep Power
    9
    PHP Code:
    MONSTER.dist <= ULTIMATE.DIST 
    I want to see the part with ULTIMATE.DIST aswell, the error is probably there.

  7. #7
    iBot User
    Join Date
    May 2012
    Location
    Spain
    Posts
    213
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    15 Post(s)
    Reputation
    32
    Rep Power
    5
    Quote Originally Posted by soder View Post
    PHP Code:
    MONSTER.dist <= ULTIMATE.DIST 
    I want to see the part with ULTIMATE.DIST aswell, the error is probably there.
    as u wish, edited on top, but i think it does nothing to do with the problem hehe
    Regards, NWA

  8. #8
    iBot User
    Join Date
    May 2012
    Location
    Spain
    Posts
    213
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    15 Post(s)
    Reputation
    32
    Rep Power
    5
    bump hehe
    Regards, NWA

  9. #9
    iBot User
    Join Date
    May 2012
    Location
    Spain
    Posts
    213
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    15 Post(s)
    Reputation
    32
    Rep Power
    5
    so, none knows whats wrong? :/
    Regards, NWA

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •