Hello :thumbup:
I have two problems with script:
1. Is way to set 2 or more catapults with different positions?? (I have tried but not work
)
2. If player is behind wall (it can be wall house or rock wall etc.) then player can't be shot.
Thanks and rep++ for help. :w00t:
I have two problems with script:
LUA:
function onThink(interval, lastExecution)
local catapultSpec = getSpectators({x = 84, y = 123, z = 7}, 5, 5, false)
local damage = math.random(100, 300)
local shooted = false
if catapultSpec ~= nil then
for i = 1, #catapultSpec do
local target = catapultSpec[i]
if isNpc(target) == false and shooted == false then
doSendDistanceShoot({x = 84, y = 123, z = 7}, getCreaturePosition(target), CONST_ANI_LARGEROCK)
doSendMagicEffect(getCreaturePosition(target), CONST_ME_BLOCKHIT)
doCreatureAddHealth(target, - damage)
doSendAnimatedText(getCreaturePosition(target), damage, TEXTCOLOR_RED)
shooted = true
return true
end
end
end
return true
end
1. Is way to set 2 or more catapults with different positions?? (I have tried but not work
2. If player is behind wall (it can be wall house or rock wall etc.) then player can't be shot.
Thanks and rep++ for help. :w00t: