yes kinda but you'll need these 2 functions which aren't in the global by default
function GetDistance(e,v)
if g_Entity[e] ~= nil and g_Entity[e] ~= 0 and g_Entity[v] ~= nil and g_Entity[v] ~= 0 then
local disx = g_Entity[e]['x'] - g_Entity[v]['x']
local disz = g_Entity[e]['z'] - g_Entity[v]['z']
local disy = g_Entity[e]['y'] - g_Entity[v]['y']
return math.sqrt(disx^2 + disz^2 + disy^2)
end
end
function RotateToEntity(e,v)
if g_Entity[e] ~= nil and g_Entity[e] ~= 0 and g_Entity[v] ~= nil and g_Entity[v] ~= 0 then
local x = g_Entity[v]['x'] - g_Entity[e]['x']
local z = g_Entity[v]['z'] - g_Entity[e]['z']
local angle = math.atan2(x,z)
angle = angle * (180.0 / math.pi)
if angle < 0 then
angle = 360 + angle
elseif angle > 360 then
angle = angle - 360
end
SetRotation(e,0,angle,0)
return angle
end
end
then rotate and check the distance - if the lead soldier is too far then set the follower to run and if not set him to walk
life\'s one big game
windows vista ultimate
i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11