• 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 WTF is going on with that array? O_O

waqmaz

Member
Joined
Jun 17, 2015
Messages
203
Reaction score
11
Code:
local t = {5518,5517,5516,5515,5514,5513,5512,5511,5510,5559,5558,5557,5556,5555,5554,5553,5552,5551} -- uid itemkow ze splashem

function onStepIn(cid, item, fromPos, item2, toPos)
    registerCreatureEvent(cid, "waterSplash")
    for i = 1, #t, 1 do
        if item.uid == t[i] then
            return doSendMagicEffect(getThingPos(cid), CONST_ME_WATERSPLASH)
        end
    end
end

The splash effect displays only on an items with ID: 5554, 5553, 5552. Lol. I've checked every item on a map and as a GM and every items have correct IDS. Any help? Oo
I think it can't hold more than 3 uniqueid. LoL.
 
Last edited:
Code:
local t = {5518,5517,5516,5515,5514,5513,5512,5511,5510,5559,5558,5557,5556,5555,5554,5553,5552,5551} -- uid itemkow ze splashem

function onStepIn(cid, item, fromPos, item2, toPos)
    registerCreatureEvent(cid, "waterSplash")
    for i = 1, #t, 1 do
        if item.uid == t[i] then
            return doSendMagicEffect(getThingPos(cid), CONST_ME_WATERSPLASH)
        end
    end

The splash effect displays only on an items with ID: 5554, 5553, 5552. Lol. I've checked every item on a map and as a GM and every items have correct IDS. Any help? Oo
I think it can't hold more than 3 uniqueid. LoL.
try this

Code:
local UNIQUES= {5518,5517,5516,5515,5514,5513,5512,5511,5510,5559,5558,5557,5556,5555,5554,5553,5552,5551}

function onStepIn(cid, item, fromPos, item2, toPos)
  local unique= UNIQUES[item.uid]
    if(unique== nil) then
          doPlayerSendCancel(cid, "UID not found.")
        return false
    end

registerCreatureEvent(cid, "waterSplash")
doSendMagicEffect(getThingPos(cid), CONST_ME_WATERSPLASH)

return true
end
 
"UID not found".
I've tried this way and still doesn't work:
Code:
function onStepIn(cid, item, fromPos, item2, toPos)
   
    registerCreatureEvent(cid, "waterSplash")
   
        if item.itemid == 11417 then
            doSendMagicEffect(getThingPos(cid), CONST_ME_WATERSPLASH)
        end

   
    return true
   
end
 
"UID not found".
I've tried this way and still doesn't work:
Code:
function onStepIn(cid, item, fromPos, item2, toPos)

    registerCreatureEvent(cid, "waterSplash")

        if item.itemid == 11417 then
            doSendMagicEffect(getThingPos(cid), CONST_ME_WATERSPLASH)
        end


    return true

end
Well lets see whats going on...

add doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"item1 id=" ..item.id.. " item 1 uid ="..item.uid.." item2 id= " ..item2.id.." item2 uid = " ..item2.uid.." .")

and start from there.
 
the error is in the UNIQUES table
Code:
local UNIQUES= {5518,5517,5516,5515,5514,5513,5512,5511,5510,5559,5558,5557,5556,5555,5554,5553,5552,5551}

function onStepIn(cid, item, fromPos, item2, toPos)
local unique= UNIQUES[item.uid]
needs to be changed to
isInArray(UNIQUES, item.uid)
or change the table to
local UNIQUES = {[5518] = true, ...}
if i got it right

btw, what is the waterSplash event supposed to d?
 
Back
Top