Lua:
local function getTargetPosition(creature)
local targetPos = creature:getTarget():getPosition()
print (targetPos.y)
local targetNorthPos = targetPos
targetNorthPos.y = targetNorthPos.y - 1
print (targetPos.y)
local targetSouthPos = targetPos
targetSouthPos.y = targetSouthPos.y + 1
targetNorthPos:sendMagicEffect(50)
targetSouthPos:sendMagicEffect(30)
end
function onCastSpell(creature, variant)
getTargetPosition(creature)
end
Can somebody tell my why variable targetPos i being changed when i created new variables which holds the position of the main variable and making changes to the new ones ?