Ir para conteúdo

Posts Recomendados

Postado

O que é: Um NPC que limpa o chão, se movendo sozinho. Possui sistema de ignore ids, pra evitar de limpar items valiosos como GPs (configurável).

Instalando:

  Mostrar conteúdo oculto

Crie um arquivo em data/lib com o nome de cleaner_lib.lua e coloque isso dentro:

CLEANER_NAME = "Cleaner" -- Name of the NPC Cleaner

 

Crie um arquivo.xml em npcs e coloque isso dentro:

  Mostrar conteúdo oculto
<?xml version="1.0" encoding="UTF-8"?>

<npc name="Cleaner" script="default.lua" walkinterval="0" floorchange="0">
    <health now="150" max="150"/>
    <look type="289" head="140" body="64" legs="121" feet="76" addons="3" corpse="2212"/>


</npc>

 

Crie um arquivo em talkactions/scripts com o nome de cleaner.lua e coloque isso dentro:

  Mostrar conteúdo oculto
function onSay(cid, words, param)

    if param == "create" then
        createCleaner()
    elseif param == "remove" then
        if not removeCleaner() then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "There aren't any cleaners.")
        else
            removeCleaner()
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Cleaner removed successfully.")
        end
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Incorrect params. You may only 'create' or 'remove' the cleaner.")
    end
return true


end

 

Tag (talkactions):

  Citar

<talkaction log="yes" words="/cleaner" access="5" script="cleaner.lua"/>

 

Configurando:

  Mostrar conteúdo oculto

Vá no arquivo 

cleaner_lib.lua (data/lib) e edite isso:

CLEANER_NAME = "Cleaner" -- Name of the NPC Cleaner

CLEANER_INITIAL_POS = {x = 95, y = 117, z = 7} -- Initial position of the cleaner
CLEANER_PZ
= true -- Clean Non-Protection Zones (true/false)
CLEANER_BACK = true -- Will the cleaner teleport back to initial pos if there's a player on the way? (true/false)
CLEANER_EFFECT = 2 -- Effect on clean
CLEANER_WALK_DELAY = 2 -- Walk delay of the cleaner (seconds)
CLEANER_IGNORE = {2148} -- Item ids ignored by the cleaner
CLEANER_PHRASES_CHANCE = 10 -- Percent of chance to the cleaner say something


CLEANER_PHRASES = {"Hello!", "I'm cleaning!"} -- Phrases that the cleaner can say

 

Vá no arquivo.xml do NPC que você criou e edite:

<npc name="Cleaner" (...)

 

<look type="289" head="140" body="64" legs="121" feet="76" addons="3" corpse="2212"/>

 

Usando:

  Citar

/cleaner create -- Cria o Cleaner

/cleaner remove -- Remove o cleaner

 

Créditos:

  Citar

- LuckOake (Pelo sistema)

 

 

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo