Lephisto/scripts/ai/test.lua
2013-02-04 17:44:53 +00:00

18 lines
277 B
Lua

-- Required control rate.
control_rate = 2
-- Required "control" function.
function control()
pushtask(0, "follow");
end
function follow()
target =1
dir = face(target)
dist = getdist(getpos(target))
if -dir < 10 and dist > 100 then
accel(dist/100-1)
end
end