Results 1 to 3 of 3

Thread: problem with toptileitem

  1. #1
    iBot User
    Join Date
    Dec 2012
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    8
    Rep Power
    0

    Cool problem with toptileitem

    Hi everybody!

    I need some help with toptileitem. The thing is that i can't figure out how to use it with two items.

    For exempel i want something to happend when one of two items is found on a certain sqm. I've tried using OR, but that doesn't work:

    if toptileitem(posx-1,posy-1,posz) == 3043 OR toptileitem(posx-1,posy-1,posz) == 3035 then
    do something
    end


    Thanks in advance!

  2. #2
    iBot User Raph_'s Avatar
    Join Date
    Feb 2013
    Posts
    391
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    59
    Rep Power
    4
    Code:
    local _IDS = {3043, 3035}
    
    if table.find(_IDS, toptileitem(posx-1, posy-1, posz)) then
    	-- doSmt()
    end

  3. #3
    iBot User
    Join Date
    Dec 2012
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    8
    Rep Power
    0
    Thank you Raph!

Posting Permissions

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