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

[XML 8.1] Lever teleport

Angelika1993

New Member
Joined
Oct 6, 2014
Messages
46
Reaction score
2
Hello,
i have problem with lever teleport
I put item id 2322 right into coal basin and click on lever .. nothing happens

  1. function onUse(cid, item, frompos, item2, topos)
  2. if item.uid == 1964 then
  3. kasapos = {x=1035, y=1004, z=7, stackpos=3}
  4. getkasa = getThingfromPos(kasapos)
  5. topos = {x=1088, y=943, z=9}
  6. if getkasa.itemid == 2322 and getkasa.type == 1 then
  7. doRemoveItem(getkasa.uid,1)
  8. doTeleportThing(cid,topos)
  9. else
  10. doPlayerSay(cid, "Nie polozyles itemu!", TALKTYPE_ORANGE_1)
  11. end
  12. return 1
  13. end
  14. end
 
please help
when i change
  1. if getkasa.itemid == 2322 and getkasa.type == 1 then
  2. to
    1. if getkasa.itemid == 2160 and getkasa.type == 1 then
    2. its working
 
Try this, no idea if it will work, because it wasn't tested.
Code:
function onUse(cid, item, frompos, item2, topos)
    if item.uid == 1964 then
        local kasaPos = {x=1035, y=1004, z=7, stackpos=3}
        local getKasa = getThingfromPos(kasaPos)
        local teleportTo = {x=1088, y=943, z=9}
        if getKasa.itemid == 2322 and getKasa.type == 1 then
            doRemoveItem(getKasa.uid, 1)
            doTeleportThing(cid, teleportTo)
        else
            doPlayerSay(cid, "Nie polozyles itemu!", TALKTYPE_ORANGE_1)
        end
        return true
    end
end
 
Try this, no idea if it will work, because it wasn't tested.
Code:
function onUse(cid, item, frompos, item2, topos)
    if item.uid == 1964 then
        local kasaPos = {x=1035, y=1004, z=7, stackpos=3}
        local getKasa = getThingfromPos(kasaPos)
        local teleportTo = {x=1088, y=943, z=9}
        if getKasa.itemid == 2322 and getKasa.type == 1 then
            doRemoveItem(getKasa.uid, 1)
            doTeleportThing(cid, teleportTo)
        else
            doPlayerSay(cid, "Nie polozyles itemu!", TALKTYPE_ORANGE_1)
        end
        return true
    end
end

Thank you for reply but still not working
2wrepg7.png
 
Code:
function onUse(cid, item, frompos, item2, topos)
    if item.uid == 1964 then
        local kasaPos = {x=1035, y=1004, z=7, stackpos=3}
        local getKasa = getThingfromPos(kasaPos)
        local teleportTo = {x=1088, y=943, z=9}
        if getKasa.itemid == 2322 then
            doRemoveItem(getKasa.uid, 1)
            doTeleportThing(cid, teleportTo)
        else
            doPlayerSay(cid, "Nie polozyles itemu!", TALKTYPE_ORANGE_1)
        end
        return true
    end
end
Try this code, it's without "and getKasa.type == 1", I think it should work now. :p
 
.type only works for stackable items, which is why the (stackable) crystal coin works, and the (non-stackable) doll does not work.

To get around this issue I use a custom function to find the amount of an item on a tile.
 
Back
Top Bottom