local fromPositions = {
{x = 10, y = 10, z = 7},
{x = 16, y = 10, z = 7},
{x = 10, y = 14, z = 7},
{x = 16, y = 14, z = 7}
}
local targetPosition = {x = 13, y = 12, z = 7}
for _, fromPosition in pairs(fromPositions) do
doSendDistanceShoot(fromPosition, targetPosition, CONST_ANI_ENERGY)
end
local fromPositions = {
{x = 1019, y = 995, z = 12},
{x = 1013, y = 995, z = 12},
{x = 1019, y = 1001, z = 12},
{x = 1013, y = 1001, z = 12}
}
local targetPosition = {x = 1016, y = 998, z = 15}
for _, fromPosition in pairs(fromPositions) do
doSendDistanceShoot(fromPosition, targetPosition, CONST_ANI_ENERGY)
end
function onThink(interval, lastExecution) -- above for ..
return true -- under end
end
<globalevent name="effect" interval="3000" event="script" value="effect.lua"/>
local fromPositions = {
{x = 1019, y = 995, z = 12},
{x = 1013, y = 995, z = 12},
{x = 1019, y = 1001, z = 12},
{x = 1013, y = 1001, z = 12}
}
local targetPosition = {x = 1016, y = 998, z = 12}
function onThink(interval, lastExecution)
end
for _, fromPosition in pairs(fromPositions) do
doSendDistanceShoot(fromPosition, targetPosition, CONST_ANI_ENERGY)
end
return true
script ?
local fromPositions = {
{x = 1019, y = 995, z = 12},
{x = 1013, y = 995, z = 12},
{x = 1019, y = 1001, z = 12},
{x = 1013, y = 1001, z = 12}
}
local targetPosition = {x = 1016, y = 998, z = 12}
function onThink(interval, lastExecution)
end
for _, fromPosition in pairs(fromPositions) do
doSendDistanceShoot(fromPosition, targetPosition, CONST_ANI_ENERGY)
end
return true
end
Code:local fromPositions = { {x = 1019, y = 995, z = 12}, {x = 1013, y = 995, z = 12}, {x = 1019, y = 1001, z = 12}, {x = 1013, y = 1001, z = 12} } local targetPosition = {x = 1016, y = 998, z = 12} function onThink(interval, lastExecution) end for _, fromPosition in pairs(fromPositions) do doSendDistanceShoot(fromPosition, targetPosition, CONST_ANI_ENERGY) return true end
Thats what @Limos meant.
local fromPositions = {
{x = 1019, y = 995, z = 12},
{x = 1013, y = 995, z = 12},
{x = 1019, y = 1001, z = 12},
{x = 1013, y = 1001, z = 12}
}
local targetPosition = {x = 1016, y = 998, z = 12}
function onThink(interval, lastExecution)
for _, fromPosition in pairs(fromPositions) do
doSendDistanceShoot(fromPosition, targetPosition, CONST_ANI_ENERGY)
end
return true
end
@Musztang THANKS BRO! LIKEHe said "move the end under onThink under return true"
So...
Code:local fromPositions = { {x = 1019, y = 995, z = 12}, {x = 1013, y = 995, z = 12}, {x = 1019, y = 1001, z = 12}, {x = 1013, y = 1001, z = 12} } local targetPosition = {x = 1016, y = 998, z = 12} function onThink(interval, lastExecution) for _, fromPosition in pairs(fromPositions) do doSendDistanceShoot(fromPosition, targetPosition, CONST_ANI_ENERGY) end return true end