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
[c]: in function "pairs"
20 and 6 line
Last edited: