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

isInArray bug?

Paulix

Active Member
Joined
Sep 13, 2012
Messages
151
Solutions
8
Reaction score
36
Code:
local orbs = {
    [11429] = {id = 11429, element = 2},
    [2096] = {id = 2096, element = 4},
    [2681] = {id = 2681, element = 8},
    [2683] = {id = 2683, element = 512},
    [2682] = {id = 2682, element = 1024},
    [12418] = {id = 12418, element = 2048}
}

local orb = getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid

if isInArray(orbs, orb) then
    ...
else
    ...
end

the problem is, even when im with right "orb" that have the correct item id, it never returns true
no idea what im doing wrong, just want to make a "default" element in case something else is equiped on ammo place
 
To access a table do something like this:

Code:
local t = orbs[orb]
i dont want to access the table, i want to check if it exist based on what item player is using, cause if they arent using any of the orbs, i need to set a default element for this table
 
Back
Top