
Witamy Na OTS Fans, Przeczytaj Regulamin lub Zarejestruj się.
I User
Autorem Jest Cassius
Oryginalny Temat
Skrypt mojego autorstwa.
1. Stwórz plik Friendly Dog.xml a do niego wklej:
<?xml version="1.0"?>
<npc name="Friendly Dog" script="data/npc/scripts/fd.lua" access="0" monster="1" speed="220" level="10" maglevel="1" exp="0" pushable="0" lookdir="0">
<health now="100" max="100"/>
<mana now="100" max="100"/>
<look type="32" head="78" body="61" legs="52" feet="114" corpse="2839"/>
</npc>2. Następnie stwórz plik fd.lua a w nim:
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
sx, sy, sz = selfGetPosition()
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, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
selfSay('How How!')
focus = cid
talk_start = os.clock()
elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Grrrrrrrrr!')
elseif focus == cid then
talk_start = os.clock()
if msgcontains(msg, 'a') then
sx, sy, sz = selfGetPosition()
selfMoveTo(sx-1, sy, sz)
elseif msgcontains(msg, 'd') then
sx, sy, sz = selfGetPosition()
selfMoveTo(sx+1, sy, sz)
elseif msgcontains(msg, 's') then
sx, sy, sz = selfGetPosition()
selfMoveTo(sx, sy+1, sz)
elseif msgcontains(msg, 'w') then
sx, sy, sz = selfGetPosition()
selfMoveTo(sx, sy-1, sz)
elseif msgcontains(msg, 'z') then
selfSay('exori mort')
elseif msgcontains(msg, 'x') then
selfSay('exura')
elseif string.find(msg, '(%a*)bye(%a*)') and getDistanceToCreature(cid) < 4 then
selfSay('Mhmmmuu... Mhmuuu... !!!')
focus = 0
talk_start = 0
end
end
end
function onCreatureChangeOutfit(creature)
end
function onThink()
if (os.clock() - talk_start) > 3600 then
if focus > 0 then
selfSay('Wuff! Wuff?')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 1000 then
selfSay('Wuff! Wuff!!! Wuuuuffff!!!!')
focus = 0
end
end
endUżycie:
Napisz hi.
Od teraz możesz nim sterować za pomocą:
w a s d (Jak strzałki - chodzenie)
z - atak
x - leczenie się
/// Nie wiem po co to komu, ale rozrywka przednia
Offline