Forum Tibia Strona Główna
FAQ Profil Szukaj Użytkownicy
Grupy

Prywatne Wiadomości

Rejestracja Zaloguj
Galerie

[7.92] NPC POLICJANT
Zobacz poprzedni temat | Zobacz następny temat >

Napisz nowy temat Odpowiedz do tematu
Tibia > Skrypty

Autor Wiadomość
Klimko
Go



Dołączył: 08 Lip 2007
Posty: 9
Przeczytał: 0 tematów

Ostrzeżeń: 0/5
Skąd: Katowice

[7.92] NPC POLICJANT    

w data/npc/Policjant.xml
Kod:
<?xml version="1.0"?>
<npc name="Policjant" script="data/npc/scripts/Policjant.lua" access="3">
<look type="128" head="20" body="100" legs="50" feet="99"/>
</npc>

data/npc/scrips/Policjant.lua
Cytat:
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('Good bye then.')
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, ' ... ')or msgcontains(msg, ' ... ')or msgcontains(msg, ' ... ')or msgcontains(msg, ' ... ')or msgcontains(msg, ' ... ') or msgcontains(msg, ' ... ) or msgcontains(msg, ' ... ') or msgcontains(msg, ' ... ') or msgcontains(msg, ' ... ') or msgcontains(msg, ' ... ') or msgcontains(msg, ' ... ') or msgcontains(msg, ' ... ') or msgcontains(msg, ' ... ')or msgcontains(msg, ' ... ')or msgcontains(msg, ' ... ') or msgcontains(msg, ' ... ')or msgcontains(msg, ' ... ') or msgcontains(msg, ' ... ') or msgcontains(msg, ' ... ')or msgcontains(msg, ' ... ')or msgcontains(msg, ' ... ')or msgcontains(msg, ' ... ') or msgcontains(msg, ' ... ') or msgcontains(msg, 'l ... ') or msgcontains(msg, ' ... ') or msgcontains(msg, ' ... ) or msgcontains(msg, ' ... ') and focus == 0) and getDistanceToCreature(cid) < 4 then
selfSay('/kick ' .. creatureGetName(cid) .. '')
focus = cid
talk_start = os.clock()
elseif msgcontains(msg, 'fuck') then
selfSay('/kick ' .. creatureGetName(cid) .. '')
elseif msgcontains(msg, 'pies')or msgcontains(msg, 'piesek')or msgcontains(msg, 'nie')or msgcontains(msg, 'Rany boskie, jestem kioskiem') then
selfSay('Masz za swoje brudasie ' .. creatureGetName(cid) .. ' ,i nie pokazuj mi się tu wiecej.')

elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('SPADAJ')

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

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


function onCreatureChangeOutfit(creature)

end


function onThink()
if focus == 0 then
cx, cy, cz = selfGetPosition()
randmove = math.random(1,20)
if randmove == 1 then
nx = cx + 2
end
if randmove == 2 then
nx = cx - 2
end
if randmove == 3 then
ny = cy + 2
end
if randmove == 4 then
ny = cy - 2
end
if randmove == 5 then
nx = cx
ny = cy
end
moveToPosition(nx, ny, cz)
--summons = 30
--summons2 = 30
end
if (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay('Next Please...')
end
focus = 0

end
end


W miejce " ... " wpisujemy słowo po którym jak kotś powie ma kick

Mam nadzieje ze sie przyda Smile Pozdro


Post został pochwalony 0 razy
Post Nie 1:38, 08 Lip 2007
 Zobacz profil autora
Napisz nowy temat Odpowiedz do tematu
Forum Jump:
Skocz do:  

Wszystkie czasy w strefie EET (Europa).
Obecny czas to Pią 16:21, 26 Kwi 2024
  Wyświetl posty z ostatnich:      


fora.pl - załóż własne forum dyskusyjne za darmo
Powered by phpBB: © 2001, 2002 phpBB Group
Template created by The Fathom
Based on template of Nick Mahon
Regulamin