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

Can't parse CID through addEvent

Ezzz

Developer of Nostalrius and The Violet Project
Joined
Feb 26, 2010
Messages
2,012
Solutions
3
Reaction score
841
Location
Europe
Hello,

so I'm having problems with this script:

LUA:
function TeleportBack(n)

    local Position = getTownTemplePosition(1)
    
    Player:Teleport(n.ad, Position)
    Player:SendEffect(n.ad, 10)
    Player:SendText(n.ad, 19, "You will be teleported back to town within 10 seconds.")

end

function onUse(cid, item, frompos, item2, topos)

    -- Nothing
    if (item.actionid == 0) then
    
        Player:SendText(cid, 19, "This scroll is blank.")
        Player:SendEffect(cid, 2)
        
    end
    
    -- Teleport Scroll
    if (item.actionid == 100) then
    
        Player:SendText(cid, 19, "You will be teleported back to town within 10 seconds.")

        local pam = {ad == cid}
        
        addEvent(TeleportBack, 10000, pam)
        --local Position = getTownTemplePosition(1)
        
        --Player:Teleport(cid, Position)
        --Player:SendEffect(cid, 10)
        --doPlayerRemoveItem(cid, 8189, 1)
        
    end
    
    return true
end

It keeps telling me a message on console;

Thing not found, Player not found, expected an integer value.

rep++
 
What about that problem but with NpcCid, someone who will fix it will be pro. =)
- (important) -> It works when we have ONLY 1 npc on server, when i summon second this function fail :(
- Using Jiddos system
Code:
       if msgcontains(msg:lower(),"bye") then
         npcHandler.focus = 0
         npcHandler:say("Good bye, "..getPlayerName(cid).."!",cid)
         a = {npc = getNpcCid()}
         addEvent(Farewell, 4000, a)
       end

function Farewell(a)
  doNpcSetCreatureFocus(0)
  return 1
end
 
Back
Top