Guloso Forum
Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.
Guloso Forum

~~> Tibia FanSite ~~> Um bocadinho de tudo! | ©Guloso | ~~

PeakBux
vcBux

Você não está conectado. Conecte-se ou registre-se

Criando E Administrando Sua Cadeia 100%, Melhorando seu SerV

2 participantes

Ir para baixo  Mensagem [Página 1 de 1]

Guloso

Guloso
Administrador
Administrador

Bom, eu deçidi postar um tutorial de como fazer um npc policial, mas é mas facil assim...
Começando...
1-Primeiro abra seu Map Editor junto com seu mapa e coloque a cadeia no lugar que voce desejar, tente fazer mais ou menos assim:

Criando E Administrando Sua Cadeia 100%, Melhorando seu SerV Tutocadeia1ei


Bom Depois de ter construido tudo, Tem que escolher o sistema que voce quer:
-Sistema Policial 10k(preço reajustável): Seria um sistema aonde se voce paga 10k ao policial voce sai da cadeia...
-Sistema de alerta by colex:(Link Aqui!) Que voce pode fazer que cada vez que a pessoa vai pra cadeia = 10% Alerta dai quando chegar ao 100% ja está no script que é banido, tem tudo explicado la.
-Normal System: Deixar a pessoa por 1 dia na cadeia(24horas[Tempo Reajustável])

Depois de escolher seu sistema, está na hora de criar os npcs Delegado, Policial, e se quiser o Advogado que voce paga 20k mais sai o alerta...
Seguem ai os npcs:
Policial:
Abra a pasta de Seu OTServ e Va em data\npc, copie um npc e cole, renomeie para Policial
Delete tudo e preencha com as seguintes informações:

<?xml version="1.0"?>
<npc name="Policial" script="data/npc/scripts/policial.lua" access="3">
<look type="131" head="114" body="88" legs="107" feet="114"/>
</npc>

Nota: Look Type é opcional

Agora va em scripts e copie a seguinte script:
-boat
Cole e renomeie para: policial
abra e delete tudo o que está lá dentro
e cole isso:

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)
if focus == cid then
selfSay('Bem feito por estar preso seu mal educado.')
focus = 0
talk_start = 0
end
end


function onCreatureTurn(creature)

end


function msgcontains(txt, str)
return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end


function onCreatureSay(cid, type, msg)
msg = string.lower(msg)

if (msgcontains(msg, 'hello') and (focus == 0)) and getDistanceToCreature(cid) < 3 then
if isPremium(cid) then
selfSay('O Que foi, ' .. creatureGetName(cid) .. '! Voce pode sair se me pagar 10k. Voce quer??')
focus = cid
talk_start = os.clock()
else
selfSay('Desculpe, Voce não tem dinheiro suficiente.')
focus = 0
talk_start = 0
end

elseif msgcontains(msg, 'hello') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Espera, ' .. creatureGetName(cid) .. '!')

elseif focus == cid then
talk_start = os.clock()

if msgcontains(msg, 'yes') then
if pay(cid,10000) then
selfSay('Espero que não volte mais!')
selfSay('/send ' .. creatureGetName(cid) .. ', 160 54 7')
focus = 0
talk_start = 0
else
selfSay('Desculpe, voce não tem grana.')
end

elseif msgcontains(msg, 'ciieeeeeeeey') then
if pay(cid,20) then
selfSay('Let\'s go!')
selfSay('/send ' .. creatureGetName(cid) .. ', 171 65 7')
focus = 0
talk_start = 0
else
selfSay('Sorry, you don\'t have enough money.')
end

elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
selfSay('Good bye, ' .. creatureGetName(cid) .. '!')
focus = 0
talk_start = 0
end
end
end


function onCreatureChangeOutfit(creature)

end


function onThink()
if (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay('Que fale o próximo se tiver...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Tá Tá agora suma.')
focus = 0
end
end
end

Nota: Aquele cieeeeey foi um erro não modifique,eu não modifiquei pois não tive tempo..

NPC: Delegado:
Em Andamento... Vou pedir um code a alguem, quem souber fazer codes .

Wink fikem bm! vou postar o resto em breve quando conseguir arranjar o Npc Delegado!

Wink

https://guloso.forumeiros.com

Uchiha

Uchiha
Supremo

vlw kra tavo kereno uma cadeio o povo tdo num obedecia

Ir para o topo  Mensagem [Página 1 de 1]

Permissões neste sub-fórum
Não podes responder a tópicos