Please help me.
The connected file is usuable 1-2 round, but after that the game is Crashing.
I dont now why, so thats while i ask you to help me.
Can it be changing : objectList:size() ??
If somebady solved this problem, please link the correct file !!!!!
I'm not familiar with the event but is it possible that while it is going through the object list in "findmob" that they might move or disappear, eg. if someone else uses them? If so you should update each object before checking it. eg.
function findMOB(_range)
printf("\n Mob find starting.\n");
if RoMScript("ExtraActionBarFrame:IsVisible()") then printf("\n Actionbar visible.\n"); end;
player:updateXYZ();
while RoMScript("ExtraActionBarFrame:IsVisible()") do
local obj = nil;
local objectList = CObjectList();
objectList:update();
for i = 0,objectList:size() do
local obj = objectList:getObject(i);
if ( obj ~= nil ) then
if RoMScript("GetPing()")>70 then yrest(200);printf("\n Ping error.\n"); end;
if ( ((obj.Name=="Kokomo") or (obj.Name=="Wood Cavy") or (obj.Name=="Baabaa Sheep")) and
( _range >= math.floor (distance(obj.X,obj.Z,player.X,player.Z)) ) ) then
player:target(obj);
RoMScript("UseExtraAction(1)");yrest(200);
repeat
player:update();
until player.Casting==false
end
end
end
end
yrest(2000);
successful=true;
end
function lookatTarget(X,Z,Y)
local angle = math.atan2(Z - player.Z, X - player.X);
local yangle = math.atan2(Y - player.Y, ((X - player.X)^2 + (Z - player.Z)^2)^.5 );
player:faceDirection(angle, yangle);
camera:setRotation(angle);
end