hi guys i have this code:
And it makes this error:
How can I change this script?
I Really need it.
Sorry for my english
Code:
local objekt = {x=5393, y=5163, z=7}
function onThink(interval, lastExecution, thinkInterval)
pos = getCreaturePosition(cid)
punkty = (((pozycja.y-pozycja.x)*(pozycja.y+pozycja.x))+((objekt.y-objekt.x)*(objekt.y+objekt.x)))
dist = math.pow(punkty, (1/2.0))
if (getPlayerItemCount(cid,2338) > 0) then
if (dist < 35) then
doSendAnimatedText(getCreaturePosition(cid), "Cos zaczyna dziac sie z ...", COLOR_GREEN)
end
end
return true
end
And it makes this error:
Code:
[23:31:06.090] [Error - CreatureScript Interface]
[23:31:06.090] data/creaturescripts/scripts/distance.lua:onThink
[23:31:06.090] Description:
[23:31:06.090] data/creaturescripts/scripts/distance.lua:4: attempt to index global 'pozycja' (a nil value)
[23:31:06.090] stack traceback:
[23:31:06.090] data/creaturescripts/scripts/distance.lua:4: in function <data/creaturescripts/scripts/distance.lua:2>
I Really need it.
Sorry for my english