• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Reply to thread

when i did it like this before i could rebirth whatever my level is so if anybody faced the same issue the solution is :

[CODE=lua]local keywordHandler = KeywordHandler:new()


local npcHandler = NpcHandler:new(keywordHandler)

NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid)              npcHandler:onCreatureAppear(cid)            end

function onCreatureDisappear(cid)           npcHandler:onCreatureDisappear(cid)         end

function onCreatureSay(cid, type, msg)      npcHandler:onCreatureSay(cid, type, msg)    end

function onThink()                          npcHandler:onThink()                        end


function creatureSayCallback(cid, type, msg)

    if(not npcHandler:isFocused(cid)) then

        return false

    end

    local player = Player(cid)

    local reblevel = 700000  -- reborn level

    if(msgcontains(msg, 'rebirth')) then

        selfSay('Are you ready to be reborn and to start a new life?', cid)

    elseif(msgcontains(msg, 'yes')) then

        if player:getLevel() >= reblevel then

            player:doRebirth()

            player:remove()

        else

            selfSay('Come back when your level is '..reblevel..'.')

        end         

    end

end


npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new())[/CODE]


Back
Top