Witam, przerobiłem gotowego npc na własne potrzeby, wszystko wydaje sie w porządku, serwer nie zgłasza żadnych błędów, ale NPC omija część instrukcji.
Skrypt:
Kod:
local focus = 0
local talk_start = 0
local target = 0
local following = false
local attacking = false

function onThingMove(creature, thing, oldpos, oldstackpos, cid, item, frompos, item2, topos)

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('Hello ' .. getCreatureName(cid) .. '. Welcome to Babylon - Your only hope for salvation. If you want to join us, say "join".')
  		focus = cid
  		talk_start = os.clock()

  	elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
  		selfSay('Wait for your turn, ' .. getCreatureName(cid) .. '.')

  	elseif focus == cid then
		talk_start = os.clock()

			if msgcontains(msg, 'join')  then
					if getPlayerTown(cid) == 6 then
						selfSay('You are already one of us. Do your best for uor community.')

					else
						selfSay('Are you shure you want to become Slave of Babylon? Other citizens of Kotachi may expel you for joining us.')
!!!------------------------odtąd nie działa-------------------------------------------!!!
						if msgcontains(msg, 'yes') then
							selfSay('Now you become one of us. Do your best for community.')
							doPlayerSetTown(cid, 6)
				
						elseif msgcontains(msg, 'no') then
							selfSay('Maybe other time, ' .. getCreatureName(cid) .. '.')
!!!------------------------dotąd nie działa-------------------------------------------!!!

						
						end
					end
					
						
					
			
			end


			

		

        elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
            selfSay('Farewell, ' .. creatureGetName(cid) .. ' Come back soon.')
            focus = 0
            talk_start = 0

 
        end
    end


function onCreatureChangeOutfit(creature)
end

function onThink()
    doNpcSetCreatureFocus(focus)
    if (os.clock() - talk_start) > 30 then
        if focus > 0 then
            selfSay('Next please!!...')
        end
        focus = 0
        talk_start = 0
    end
    if focus ~= 0 then
        if getDistanceToCreature(focus) > 5 then
            selfSay('Good Bye')
            focus = 0
            talk_start = 0
        end
    end
end
Gdy gracz powie join odpowiada jak trzeba, ale potem nie reaguje ani na yes ani no.