Odp: A wie? nan PRO?BE DO SKRYPTER?W !
MAM TAK I DALEJ NIE DZIA?A :/
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 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('Witaj, ' .. creatureGetName(cid) .. 'w GM Shopie!')
focus = cid
talk_start = os.clock()
elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Przepraszam, ' .. creatureGetName(cid) .. '! POrozmiawiam z toba za minute.')
elseif focus == cid then
talk_start = os.clock()
if msgcontains(msg, 'demon legs') then
buy(cid,2495,getCount(msg),10000)
elseif msgcontains(msg, 'demon armor') then
buy(cid,2494,getCount(msg),)
elseif msgcontains(msg, 'golden helmet') then
buy(cid,2471,getCount(msg),10000)
elseif msgcontains(msg, 'super axe') then
buy(cid,7411,getCount(msg),10000)
elseif msgcontains(msg, 'super sword') then
buy(cid,74201,getCount(msg),10000)
elseif msgcontains(msg, 'super club') then
buy(cid,7422,getCount(msg),50000)
elseif msgcontains(msg, 'death wand') then
buy(cid,2184,getCount(msg),10000
elseif msgcontains(msg, 'golden bow') then
buy(cid,7438,getCount(msg),10000)
elseif msgcontains(msg, 'assassin star') then
buy(cid,7368,getCount(msg),10000)
elseif msgcontains(msg, 'super sd') then
buy(cid,2263,getCount(msg),30000)
elseif msgcontains(msg, 'super uh') then
buy(cid,2275,getCount(msg),10000)
elseif msgcontains(msg, 'super uh') then
buy(cid,2275,getCount(msg),10000)
elseif msgcontains(msg, 'super explosion') then
buy(cid,2314,getCount(msg),10000)
elseif msgcontains(msg, 'super manarune') then
buy(cid,2292 100,getCount(msg),10000)
elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
selfSay('Do widzenia.')
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('Jak chcesz..')
focus = 0
end
end
end