Problem z NPC! - pom?? kto?

Hoster THX

User
Zarejestrowany
Dołączył
Maj 26, 2009
Posty
30
Liczba reakcji
0
Siema , mam problem z NPC - dodalem do niego pare expow ktore dzialaja , ale gdy dzis rano dodalem exp kolejny , i jest cos nie tak.
Gdy w?anczam Ots i gdy ?aduje si? juz npc.xml , pokazuje mi co cos takiego:
blad.jpg
No tak,si? pokazuj?, ale NPC dzia?a i wysy?a ludzi na exp:
ale denerwuje mnie to ze tak skacze ta linijke non stop, moze cos w Script,
Tutaj one - moze cos zle to jak by ktos mogl loknac na to i naprawic jak widzi blad
Kod:
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('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
		if isPremium(cid) then
			selfSay('[devil island] , [mv island] , [dragon land] , [orshabaal land] ,[mystic demon]')
			focus = cid
			talk_start = os.clock()
		else
			selfSay('Ta lodz jest tylko dla graczy z premium account!.')
			focus = 0
			talk_start = 0
		end
  	elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
  		selfSay('Sorry, ' .. creatureGetName(cid) .. ' poczekaj!.')
  	elseif focus == cid then
		talk_start = os.clock()
		if msgcontains(msg, 'dragon land') then
			if pay(cid,50) then
				selfSay('/send ' .. creatureGetName(cid) .. ', 122 119 7')
				focus = 0
				talk_start = 0
			else
				selfSay('Nie masz kasy!.')
			end
		elseif msgcontains(msg, 'city') then
			if pay(cid,20) then
				selfSay('/send ' .. creatureGetName(cid) .. ', 118 60 7')
				focus = 0
				talk_start = 0
			else
				selfSay('Nie masz kasy!.')
			end
 		elseif msgcontains(msg, 'devil island') then
			if pay(cid,20) then
				selfSay('/send ' .. creatureGetName(cid) .. ', 130 214 7')
				focus = 0
				talk_start = 0
			else
				selfSay('Nie masz kasy!.')
			end
		elseif msgcontains(msg, 'mv island') then
			if pay(cid,20) then
				selfSay('/send ' .. creatureGetName(cid) .. ', 229 236 7')
				focus = 0
				talk_start = 0
			else
				selfSay('Nie masz kasy!.')
			end
		elseif msgcontains(msg, 'mystic demon') then
			if pay(cid,200) then
				selfSay('/send ' .. creatureGetName(cid) .. ', 326 70 7')
				focus = 0
				talk_start = 0
			else
				selfSay('Nie masz kasy!.')
			end
		elseif msgcontains(msg, 'orshabaal land') then
			if pay(cid,20) then
				selfSay('/send ' .. creatureGetName(cid) .. ', 262 210 7')
				focus = 0
				talk_start = 0
			else
				selfSay('Nie masz kasy!.')
			end
		elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
			selfSay('Good bye, ' .. creatureGetName(cid) .. '!')
			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('Next Please...')
  		end
  			focus = 0
  	end
	if focus ~= 0 then
 		if getDistanceToCreature(focus) > 5 then
 			selfSay('Good bye then.')
 			focus = 0
 		end
 	end
end
Thx, mysl? ze pomo?ecie : (
 
Back
Do góry