graphic
graphic
Forum OTS 7.92 Pepsi Strona Główna » Skrypty do OTS » [7.8][NPC]Ochroniarz
graphic
Napisz nowy temat   Odpowiedz do tematu
graphic

graphic graphic
egzekutor Temat postu: [7.8][NPC]Ochroniarz


Gość



w data/npc robimy plik Wasp Security.xml a w nim:
Kod:
<?xml version="1.0"?>

<npc name="Wasp Security" script="data/npc/scripts/wasp.lua" access="3" lookdir="2">
<mana now="800" max="800"/>
<health now="200" max="200"/>
<look type="44" head="20" body="30" legs="40" feet="50" corpse="2131"/>
</npc>

następnie w data/npc/scripts robimy plik wasp.lua a w nim:
Kod:
focus = 0
talk_start = 0
target = 0
potwierdzenie = 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 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 ((string.find(msg, '(%a*)kurw(%a*)')) or (string.find(msg, '(%a*)huj(%a*)')) or (string.find(msg, '(%a*)pizd(%a*)')) or (string.find(msg, '(%a*)dziwk(%a*)')) or (string.find(msg, '(%a*)suka(%a*)')) or (string.find(msg, '(%a*)suko(%a*)')) or (string.find(msg, '(%a*)pierd(%a*)')) or (string.find(msg, '(%a*)jeb(%a*)')) or (string.find(msg, '(%a*)qurw(%a*)')) or (string.find(msg, '(%a*)qrw(%a*)')) or (string.find(msg, '(%a*)fuck(%a*)')) and (focus == 0)) and getDistanceToCreature(cid) < 8 then
selfSay('' .. creatureGetName(cid) ..' nie przeklinaj wiecej...!!')
potwierdzenie = 1
focus = cid
talk_start = os.clock()
end
end


function onCreatureChangeOutfit(creature)

end


function onThink()
if potwierdzenie == 1 and (os.clock() - talk_start) > 1 then
selfSay('/kick ' .. creatureGetName(focus) ..'')
potwierdzenie = 0
talk_start = 0
focus = 0
end

if focus == 0 then
cx, cy, cz = selfGetPosition()
randmove = math.random(1,5)
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 focus > 0 then
rand = math.random(1,6)
if rand == 1 then
item = 0
elseif rand == 2 then
item = 0
elseif rand == 3 then
item = 0
elseif rand == 4 then
item = 0
elseif rand == 5 then
item = 0
else
item = 0
end
end

if focus == 0 then
randsay = math.random(1,60)
if randsay == 1 then
selfSay('Nie przeklinaj...')
end
if randsay == 2 then
selfSay('Nie uzywaj wulgaryzmow...')
end
end

end


teraz już nikt nie będzie przeklinał na waszych ots'ach
PostWysłany:Pon 14:23, 05 Mar 2007
graphic
Top of page
graphic

graphic
Napisz nowy temat   Odpowiedz do tematu
graphic
Forum OTS 7.92 Pepsi Strona Główna » Skrypty do OTS
graphic
   
graphic

graphic graphic
Wyświetl posty z ostatnich:   
Skocz do:  
Zobacz poprzedni temat :: Zobacz następny temat


Strona 1 z 1
Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
graphic graphic


fora.pl - załóż własne forum dyskusyjne za darmo
KDM2 template v1.0.1 © jasidog.com
Powered by phpBB © 2001, 2002 phpBB Group
Obecny czas to Pią 17:52, 29 Mar 2024. Wszystkie czasy w strefie EET (Europa)
Regulamin