I am trying to create a function that every 5 seconds or so, a bot will randomly move using
function AIPlayer::moverand(%a)
{
%a.schedule(5000,randomMove);
}
it works so the bot moves around in a random direction but only once. is there a way to set it to loop forever, like this firegun function does?
function AIPlayer::fireGun(%a)
{
%a.setImageTrigger(0,0);
%a.setImageTrigger(0,1);
%a.schedule(1000,fireGun);
}
(the firegun function loops forever as far as i know)
Note: Fixed.