Czy poda mi ktoś scrypt do NPC Zamieniajacego itemki??? Pod Evo 7.8
Znalalem juz 1 npc ale muwie power tak jak bylu ustawione w pliku i npc sie nieodzywa a na serverze nic sie niewyświetla ze bład jest w npc niewiem dlaczego tak jest ale podam wrazie czego script pomurzcie PLZ
Z Gury Thx
function onCreatureSay(cid, type, msg) cname = creatureGetName(cid)
if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then selfSay('Hey ' .. cname .. '! What can I get for ya?') talk_state = 1 focus = cid talk_start = os.clock() elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then selfSay('Chill out '.. creatureGetName(cid) ..', Ill be done in a second.')
elseif focus == cid then soulorbs = getPlayerItemCount(cid,5944) -- this is the item you are going to give the NPC talk_start = os.clock() if msgcontains(msg, 'power') then -- you will change this to what you want if (soulorbs > 0) then -- this says if you have more then 0 soul orbs. selfSay('I will give you '..(soulorbs*5)..' power bolts for your '..soulorbs..' soul orbs. Are you intrested?') -- this npc will offer you 100 power bolts if you are carrying 20 soul orbs. (soul orbs * 5) talk_state = 2 else selfSay('You dont have any soul orbs, come back when you have some.') focus = 0 end elseif msgcontains(msg, 'bye') then selfSay('See ya.') focus = 0 end
if msgcontains(msg, 'yes') then freeCap = getPlayerFreeCap(cid) if talk_state == 2 then if (freeCap > (soulorbs*4)) then -- you can edit this to the exact weight of other items, bolts are stackable though. doPlayerTakeItem(cid,5944,soulorbs) -- he takes this item selfSay('Enjoy the bolts and come back soon!') doPlayerAddItem(cid,2547,(soulorbs*5)) -- he gives this item focus = 0 else selfSay('You cant even carry them, get back to me later.') focus = 0 end end end end end
|
a może zamiast cname function onCreatureSay(cid, type, msg) cname = creatureGetName(cid)
if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then selfSay('Hey ' .. cname .. '! What can I get for ya?') talk_state = 1 focus = cid talk_start = os.clock() elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then selfSay('Chill out '.. creatureGetName(cid) ..', Ill be done in a second.')
elseif focus == cid then soulorbs = getPlayerItemCount(cid,5944) -- this is the item you are going to give the NPC talk_start = os.clock() if msgcontains(msg, 'power') then -- you will change this to what you want if (soulorbs > 0) then -- this says if you have more then 0 soul orbs. selfSay('I will give you '..(soulorbs*5)..' power bolts for your '..soulorbs..' soul orbs. Are you intrested?') -- this npc will offer you 100 power bolts if you are carrying 20 soul orbs. (soul orbs * 5) talk_state = 2 else selfSay('You dont have any soul orbs, come back when you have some.') focus = 0 end elseif msgcontains(msg, 'bye') then selfSay('See ya.') focus = 0 end
if msgcontains(msg, 'yes') then freeCap = getPlayerFreeCap(cid) if talk_state == 2 then if (freeCap > (soulorbs*4)) then -- you can edit this to the exact weight of other items, bolts are stackable though. doPlayerTakeItem(cid,5944,soulorbs) -- he takes this item selfSay('Enjoy the bolts and come back soon!') doPlayerAddItem(cid,2547,(soulorbs*5)) -- he gives this item focus = 0 else selfSay('You cant even carry them, get back to me later.') focus = 0 end end end end end
daj to getCreatureName(cid)
|