Ir para conteúdo
  • 0
Entre para seguir isso  
Luan MF

Scripting [Pedido]Script de NPC para auto clean

Pergunta

Luan MF    7
Luan MF

Olá gostaria de pedir a ajuda de você com um script, para ExtremeOT 7.6 XML, o server fica meio salaga as vezes por ter muito lixo no chão e estou querendo bolar um sistema de auto clean, e como não tenho as sources não consigo fazer, porem estive pensando e tenho um NPC que tem accesso de GOD e ele faz anuncios no /B eu gostaria que ele fizes esse anuncio "Clean map em 1 min, guarde seus itens", "clean map em 30 segundos, guarde seus itens" isso a cada umas 4 horas mais ou menos e logo em seguida mande o comando /clean. O script ja esta pronto porem ele fala de maneira aleatoria por um tempo que eu especifiquei, gostaria que alguem me ajudasse a editar esse script para o que eu citei acima

script que eu tenho é esse:
 

Citar

 

focus = 0
talk_start = 0
target = 0
following = false
attacking = false

function onThingMove(creature, thing, oldpos, oldstackpos)
end

function onCreatureAppear(creature)
selfSay('Ola Aventureiro eu sou um Bot do ADM.') -- Its greeting sentence,= when something appears
end


function onCreatureDisappear(cid, pos)
end

function onCreatureTurn(creature)
end

function msgcontains(txt, str)
end

function onCreatureSay(cid, type, msg)
end

function onCreatureChangeOutfit(creature)
end

function onThink()

if focus == 0 then -- the move sccript
cx, cy, cz = selfGetPosition()
randmove = math.random(1,15)
    if randmove == 1 then
    nx = cx + 1
    end
    if randmove == 2 then
    nx = cx - 1
    end
    if randmove == 3 then
    ny = cy + 1
    end
    if randmove == 4 then
    ny = cy - 1
    end
    if randmove >= 5 then
    nx = cx
    ny = cy
    end
end

moveToPosition(nx, ny, cz)

randsay = math.random(3000) -- how frecuently your bot will say 
if randsay == 20 then -- something, you should set it to less than
                     -- 600 or it will end up crashin your serv 
selfSay('/B Quem puder ajudar para manter o Sever online cada item custa 10 Reais e esta no templo os itens disponiveis Segue o link para doar: https://pag.ae/7UCQpqtB3') -- Notice 1
end
end

 

 

Compartilhar este post


Link para o post
Compartilhar em outros sites

2 respostass a esta questão

Recommended Posts

  • 0
Majesty    1755
Majesty

data/npc/NPC Clean.xml:

Spoiler

<?xml version="1.0"?>
<npc name="Clean" script="data/npc/scripts/clean.lua" access="3">
<look type="130" head="132" body="116" legs="116" feet="76"/>
</npc>

 

data/npc/scripts/clean.lua:

Spoiler

astclean = 0
hasWarned = 0
focus = 0
talk_start = 0
target = 0
following = false
attacking = false

function onThingMove(creature, thing, oldpos, oldstackpos)

end


function onCreatureAppear(creature)

end


function onCreatureDisappear(cid, pos)

end


function onCreatureTurn(creature)

end


function onCreatureSay(cid, type, msg)

end

function onCreatureChangeOutfit(creature)

end


function onThink()
if lastclean == 0 then
lastclean = os.time()
end
if os.difftime(os.time(), lastclean) >= (239*60) and hasWarned == 0 then
selfSay('/B Clean map em 1 minuto. Guarde os seus itens!')
hasWarned = 1
end
if os.difftime (os.time(), lastclean) >= (240*60) then
selfSay('/clean')
lastclean = os.time()
end
end

 

 

Compartilhar este post


Link para o post
Compartilhar em outros sites
  • 0
Luan MF    7
Luan MF

@Majesty

Obrigado brother funcionou aki !!!!!

Compartilhar este post


Link para o post
Compartilhar em outros sites
Visitante
Este tópico está impedido de receber novos posts.
Entre para seguir isso  

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×