Witam ponownie a zatem juz daje jak to zrobic!!!
Wchodzimy w notatnik i wpisujemy tam
local focus = 0 local talk_start = 0 local target = 0 local following = false local 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 onCreatureSay(cid, type, msg) local msg = string.lower(msg) if msgcontains(msg, 'hi') and focus == 0 and getDistanceToCreature(cid) < 4 then selfSay('Hello ' .. creatureGetName(cid) .. '! Sellam backpacki run (bp runes).') focus = cid talk_start = os.clock() elseif msgcontains(msg, 'yo') and focus ~= cid and getDistanceToCreature(cid) < 4 then selfSay('Przepraszam, ' .. creatureGetName(cid) .. '! czekaj chwile!.') elseif focus == cid then talk_start = os.clock() if msgcontains(msg, 'backpacks') or msgcontains(msg, 'bp runes') then selfSay('Witaj sprzedaje bpki manarun,sd,uh,potków,itp') elseif msgcontains(msg, 'bp sd') then buyContainer(cid,2003,2268,10,100000) elseif msgcontains(msg, 'bp hmm') then buyContainer(cid,1998,2311,100,100000) elseif msgcontains(msg, 'bp uh') then buyContainer(cid,2002,2273,10,100000) elseif msgcontains(msg, 'bp manrune') then buyContainer(cid,2000,2270,100,100000) elseif msgcontains(msg, 'bp explosion') or msgcontains(msg, 'bp explo') then buyContainer(cid,2001,2313,100,100000) elseif msgcontains(msg, 'bp mwall') then buyContainer(cid,1999,2293,100,100000) elseif msgcontains(msg, 'bp strong health potion') then buyContainer(cid,1999,7588,1,100000) elseif msgcontains(msg, 'bp strong mana potion') then buyContainer(cid,1999,7589,1,200000) elseif msgcontains(msg, 'bp mana potion') then buyContainer(cid,1999,7620,1,200000) elseif msgcontains(msg, 'bp health potion') then buyContainer(cid,1999,7618,1,200000) elseif msgcontains(msg, 'bp great mana potion') then buyContainer(cid,1999,7590,1,200000) elseif msgcontains(msg, 'bp great health potion') then buyContainer(cid,1999,7591,1,200000) elseif string.find(msg, '(%a*)nara(%a*)') 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('Nastepny...') end focus = 0 end if focus ~= 0 then if getDistanceToCreature(focus) > 5 then selfSay('No narka.') focus = 0 end end end
Gdy juz wpiszemy to, zapisujemy pod nazwą runki.lua i wrzucamy do data/npc/scripts
Gdy juz wrzucimy to wchodzimy w data/npc i tworzymy npc
wchodzimy znowu w notatnik i piszemy
<?xml version="1.0"?> <npc name="Kondzio" script="data/npc/scripts/runki.lua" access="3" lookdir="2" autowalk="1"> <mana now="666" max="666"/> <health now="200" max="200"/> <look type="134" head="114" body="113" legs="113" feet="113"/> </npc>
zapisujemy to jako Kondzio.xml
gdy juz zapiszemy wchodzimy w data/npc i wrzucamy ten skrypt
I teraz patrzymy czy działa tzn. odpalamy silnik jesli zaden błąd nie wyskoczy to znaczy ze wszystko jest ok
Offline