• TibiaFace

    Tibiaface | Una comunidad Open Tibia donde encontras : mapas, scripts, Otserver, npc y amigos etc ...

    .
    demo menumenu

    Afiliados



    Votar:

    [CreatureEvents] problema con creaturescript

    Compartir:

    Ver el tema anterior Ver el tema siguiente Ir abajo  Mensaje (Página 1 de 1.)

    1[CreatureEvents] problema con creaturescript Empty [CreatureEvents] problema con creaturescript Miér Sep 13, 2023 11:13 pm

    akane

    akane
    Miembro
    Miembro
    Descripcion escribió:Hola a todos, estaba editando este script de acuerdo a mi server, pero tengo un problema cuando por ejemplo quiero matar un demon, al matarlo no me aparece la cantidad de demons que llevo, pero si en el script cambio el demon por cualquier monster debil como rotworm, pirates, etc ahí si me aparece la cuenta de cuantos monster maté.

    acá el script:

    Código:
    local monsters = {
    --name = storage
    ["demon"] = 45006,
    ["pirate marauder"] = 45007,
    ["pirate ghost"] = 45008

    }

    function onKill(cid, target)
    if(isPlayer(target) ~= TRUE) then
    local name = getCreatureName(target)
    local monster = monsters[string.lower(name)]
    if(monster) then
    local killedMonsters = getPlayerStorageValue(cid, monster)
    if(killedMonsters == -1) then
    killedMonsters = 1
    end
    if(name == "demon") and getPlayerStorageValue(cid, 86669) == 2 then
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have killed " .. killedMonsters .. " of 12 monsterb.")
    setPlayerStorageValue(cid, monster, killedMonsters + 1)
    elseif(name == "pirate marauder") and getPlayerStorageValue(cid, 86669) == 2 then
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have killed " .. killedMonsters .. " of 12 monsterc.")
    setPlayerStorageValue(cid, monster, killedMonsters + 1)
    elseif(name == "pirate ghost") and getPlayerStorageValue(cid, 86669) == 2 then
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have killed " .. killedMonsters .. " of 12 monsterd.")
    setPlayerStorageValue(cid, monster, killedMonsters + 1)

    if getPlayerStorageValue(cid, 45006) >= 12 and getPlayerStorageValue(cid, 45007) >= 12 and getPlayerStorageValue(cid, 45008) >= 12 then
    setPlayerStorageValue(cid, 86669, 3)

    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have killed enought pirate's.")
    end

    end
    end
    return TRUE
    end
    end

    como dije anteriormente al dejar el script con ["demon"] = 45006, no me cuenta las kills cuando mato a un demon, pero si lo dejo como ["rotworm"] = 45006, si las cuenta (el problema no es el storage si no el nombre del monster)
    Captura del Error escribió:Imagen del error: [CreatureEvents] problema con creaturescript Empty
    El error radica en: CreatureScript

    Ver el tema anterior Ver el tema siguiente Volver arriba  Mensaje (Página 1 de 1.)

    Permisos de este foro:
    No puedes responder a temas en este foro.

     

    BienvenidosTibiaFace es una comunidad de Open Tibia. Para participar debes estar registrado (click para Regístrate).