• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[8.4] Npc error function onthink

T O M E K

New Member
Joined
May 12, 2008
Messages
12
Reaction score
0
Code:
function onThink()
talk = math.random(1,100)
	if talk == 1 then
		selfSay("Only quality steel and wood used for my weapons!")
	end
if talk == 2 then
		selfSay("Give those monsters a good whipping with my weapons!")
	end
if talk == 3 then
		selfSay("Buy your weapons here!")
	end
if talk == 4 then
		selfSay("Selling and buying all sorts of weapons, come and have a look!")
	end
	for i, focus  in pairs(focuses) do
		if(isCreature(focus) == FALSE) then
			removeFocus(focus)
		else
			local distance = getDistanceTo(focus) or -1
			if((distance > 4) or (distance == -1)) then
				selfSay("Um yeah, good day.")
				closeShopWindow(focus)
				removeFocus(focus)
			end
 
		end
 
	end
	lookAtFocus()
end
My error
[c]: in function "pairs"
20 and 6 line
 
Last edited:

Similar threads

Back
Top