Lephisto/scripts/ai/test.lua
Allanis d2c548218d [Add] Message system.
[Fix] Spinning lazer thingy.
2013-02-07 20:54:34 +00:00

21 lines
352 B
Lua

-- Required control rate.
control_rate = 2
-- Required "control" function.
function control()
say("IMA KILL YOU!!");
pushtask(0, "attack");
end
function attack()
target = 0
dir = face(target)
dist = getdist(getpos(target))
if dir < 10 and dist > 100 then
accel(dist/100-1)
elseif dir < 10 and dist < 100 then
shoot()
end
end