Shadowman321
Member
- Joined
- Mar 27, 2010
- Messages
- 205
- Reaction score
- 22
PHP:
[Error - CreatureScript Interface]
data/creaturescripts/scripts/zombie/onattack.luanStatsChange
Description:
data/lib/032-position.lua:2: attempt to index global 'position' (a nil value)
stack traceback:
data/lib/032-position.lua:2: in function 'isInRange'
data/creaturescripts/scripts/zombie/onattack.lua:36: in function <data/creaturescripts/scripts/zombie/onattack.lua:35>
Topic: http://otland.net/f82/zombie-event-new-version-bug-free-updated-128664/
- - - Updated - - -
Its something wrong with it?
PHP:
function isInRange(pos, fromPosition, toPosition)
return (position.x >= fromPosition.x and position.y >= fromPosition.y and position.z >= fromPosition.z and position.x <= toPosition.x and position.y <= toPosition.y and position.z <= toPosition.z)
end
WhereisInRange(getThingPosition(target), ZE_spawnFromPosition, ZE_spawnToPosition)
Does not work.ZE_spawnFromPosition = {x = 745, y = 1085, z = 7}
ZE_spawnToPosition = {x = 781, y = 1108, z = 7}
I think i need to change pos near function isInRange, but i dont know how it have to looks like. Someone help?
@EDIT
Ok my error is solved. I have change method. Changed isInRange to getPlayerStorageValue. Changing on enter and on attack(when exit). And it works.
I still dont know how to use isInRange, so can anyone help?
Last edited: