Odrazu mowie ze to niemuj Skrypt ale myślałam ze Devil moze to wstawic .
Wiec zaczynamy :
w DATA/ACTIONS/ACTIONS.XML
I dodajecie taka tam linijke <action itemid="2802" script="ziolo.lua" /> Teraz zapisujecie to, wchodzicie w folder SCRIPTS I robicie plik ZIOLO.LUA A do niego wklejacie: MAX_FOOD = 500 function onUse(cid, item, frompos, item2, topos) -- Get food value depending on item.itemid food = 60 if (getPlayerFood(cid) + food > MAX_FOOD) then doPlayerSendCancel(cid,"O fuck... I took tooo much.") return 1 end doPlayerFeed(cid,food) doRemoveItem(item.uid,1) doPlayerAddHealth(cid,350) doSendMagicEffect(topos,2) doPlayerSay(cid,"It is great stuff!",1) return 1 end Zapisujecie a nastepnie wchodzicie w DATA/NPC robisz plik "DENAR.XML" i znow wklejacie do niego takie cos <?xml version="1.0"?>
<npc name="Denar" script="data/npc/scripts/narkotyki.lua" access="3"> <health now="1" max="1"/> <look type="134" head="0" body="0" legs="0" feet="0"/> </npc> Wchodzisz w scripts (w folderze "NPC") i tworzysz plik Narkotyki.lua i wklejasz do niego to: -- Respawn position set --ox = 163 --oy = 40 --oz = 7 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('But remember... You dont know me!.') 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 ((string.find(msg, '(%a*)hi(%a*)')) and (focus == 0)) and getDistanceToCreature(cid) < 4 then selfSay('Yo yo ' .. creatureGetName(cid) .. '! Do you want to buy some... narcotics? Only 1k.') focus = cid talk_start = os.clock() elseif string.find(msg, '(%a*)hi(%a*)') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then selfSay('Get lost, ' .. creatureGetName(cid) .. '! I takl to you in a minute...') elseif msgcontains(msg, 'narcotics') and focus == cid then buy(cid,2802,100,1000) elseif string.find(msg, '(%a*)bye(%a*)') and focus == cid and getDistanceToCreature(cid) < 4 then selfSay('Yo yo, ' .. creatureGetName(cid) .. '! Bye. remember... I dont know you and you dont know me!') focus = 0 talk_start = 0 end end
function onCreatureChangeOutfit(creature)
end function onThink() if (os.clock() - talk_start) > 30 then if focus > 0 then selfSay('Ok ok! Next!...') end focus = 0 end if focus ~= 0 then if getDistanceToCreature(focus) > 5 then selfSay('Yeah yeah, go to your mummy!') focus = 0 end end end
I gotowe :]]
|