Siemka, mam pewien problem z skryptem, chodzi o to, ?e jak mam do wykonania questa ma zabra? 5 item?w a zabiera tylko 1 o to skrypt, m?g?by kto? zobaczy? w czym jest b??d i poprawi? mnie?
[LUA]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') then
selfSay('Give me 5 fragment of Senzu, you get senzu and experience?')
focus = cid
talk_start = os.clock()
elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Sorry, ' .. getCreatureName(cid) .. '! I talk to you in a minute.')
elseif focus == cid then
talk_start = os.clock()
if msgcontains(msg, 'yes') then
if getPlayerStorageValue(cid,1001233) == 1 then
selfSay('Sorry You Cant Do this quest.')
elseif msgcontains(msg, 'yes') then
if doPlayerRemoveItem(cid,7404,1) == 0 and
doPlayerRemoveItem(cid,2141,1) == 0 and
doPlayerRemoveItem(cid,2139,1) == 0 and
doPlayerRemoveItem(cid,2171,1) == 0 and
doPlayerRemoveItem(cid,4873,1) == 0 then
selfSay('Sorry Dont have that items.')
else
if doPlayerAddItem(cid,6569,1) and doPlayerAddExp(cid, 30000000) then
setPlayerStorageValue(cid,1001233,1)
selfSay('Thanks take this')
focus = 0
talk_start = 0
end
end
end
elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
selfSay('Good bye, ' .. getCreatureName(cid) .. '!')
focus = 0
talk_start = 0
end
end
end
function onThink()
doNpcSetCreatureFocus(focus)
if (os.clock() - talk_start) > 45 then
if focus > 0 then
selfSay('Next Please...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Good bye then.')
focus = 0
end
end
end[/LUA]
[LUA]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') then
selfSay('Give me 5 fragment of Senzu, you get senzu and experience?')
focus = cid
talk_start = os.clock()
elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Sorry, ' .. getCreatureName(cid) .. '! I talk to you in a minute.')
elseif focus == cid then
talk_start = os.clock()
if msgcontains(msg, 'yes') then
if getPlayerStorageValue(cid,1001233) == 1 then
selfSay('Sorry You Cant Do this quest.')
elseif msgcontains(msg, 'yes') then
if doPlayerRemoveItem(cid,7404,1) == 0 and
doPlayerRemoveItem(cid,2141,1) == 0 and
doPlayerRemoveItem(cid,2139,1) == 0 and
doPlayerRemoveItem(cid,2171,1) == 0 and
doPlayerRemoveItem(cid,4873,1) == 0 then
selfSay('Sorry Dont have that items.')
else
if doPlayerAddItem(cid,6569,1) and doPlayerAddExp(cid, 30000000) then
setPlayerStorageValue(cid,1001233,1)
selfSay('Thanks take this')
focus = 0
talk_start = 0
end
end
end
elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
selfSay('Good bye, ' .. getCreatureName(cid) .. '!')
focus = 0
talk_start = 0
end
end
end
function onThink()
doNpcSetCreatureFocus(focus)
if (os.clock() - talk_start) > 45 then
if focus > 0 then
selfSay('Next Please...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Good bye then.')
focus = 0
end
end
end[/LUA]
Dosta?em skrypt 