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

Solved LOL getPlayerSlotItem Works?

Binho®

KooL =D
Joined
May 27, 2008
Messages
344
Reaction score
0
Location
BrZ Style
Recalling that: backpackCheck = getPlayerSlotItem(cid, 3)
Appears this error:
luaGetPlayerSlotItem(). Player not found
Code:
function onStepIn(cid, item, position, fromPosition)
    if item.uid == 36202 then
                if isPlayer(cid) == TRUE then
                    if backpackCheck.itemid == amulet then
                    doSummonCreature("Demon", demonPos)
    else
                doTeleportThing(cid, entrancePos, FALSE)
                doPlayerSendTextMessage(cid, 25, 'You need the amulet to enter.')
                end
    end
end
end
 
Last edited:
cid returns nil, as I can see the backpackCheck is outside of the function, put it below function onStepIn(...)

Also, you can use it like this: if getPlayerSlotItem(cid, 3).itemid == something then
 
cid returns nil, as I can see the backpackCheck is outside of the function, put it below function onStepIn(...)

Also, you can use it like this: if getPlayerSlotItem(cid, 3).itemid == something then

Full script!!

Code:
local amulet = 8266
local demonPos = { x = 16498, y = 15650, z = 12}
local backpackCheck = getPlayerSlotItem(cid, 3)
local entrancePos = { x = 16498, y = 15663, z = 12 }

function onStepIn(cid, item, position, fromPosition)
    if item.uid == 36202 then
                if isPlayer(cid) == TRUE then
                    if backpackCheck.itemid == amulet then
                    doSummonCreature("Demon", demonPos)
    else
                doTeleportThing(cid, entrancePos, FALSE)
                doPlayerSendTextMessage(cid, 25, 'You need the amulet to enter.')
                end
    end
end
end
I edit, and appears the same error.
Code:
local demonPos = { x = 16498, y = 15650, z = 12}
local entrancePos = { x = 16498, y = 15663, z = 12 }

function onStepIn(cid, item, position, fromPosition)
    if getPlayerSlotItem(cid, 3).itemid == 2493 then
        if item.uid == 36202 then
            if isPlayer(cid) == TRUE then
                        doSummonCreature("Demon", demonPos)
    else
                doTeleportThing(cid, entrancePos, FALSE)
                doPlayerSendTextMessage(cid, 25, 'You need the amulet to enter.')
                end
    end
end
end
Tried... tried.. tried and works.

Thanks Marcinek!
 
Last edited by a moderator:
Back
Top