My idea is to use RepeatingTask, set it around 3 ticks is optimal. On every tick, spawn a new particle around Player, and saves the last particle spawn coordinate for next particle. I think this can achieve that "fly" animation.
PHP: $r = 1; //Radius, the distance of the particle and the player$diff = 30; //The smaller, the smoother the transition effectfor($theta = 0; $theta <= 360; $theta += $diff){ $x = $r * sin($theta); $z = $r * cos($theta); //Add up player x, z with above $x, $z and spawn the particle} This is the code for Circular Coordinate Calculation. In every for loop, new $x diff anf $z diff is calculated, just add the diff x and z with Player's x, z and it should be working fine. I think this is the one you looking for EDIT: This is the basic one 2d Circle Calculation, remember to lift up Player's Y to show it around player. And I havent test this code, but the concept of that code is correct
Oh but wait.. Your code has problem. In Sine and Cosine, 30° is actually no difference with 150° as sin(30) an sin(150) are both 1/2, so when $theta in the for loop is the (value <= 90)+180 then those X positions would be same.
You forgot to think of Z When theta = 30, diffX = sin(30) = 0.5 diffZ =cos(30) = 0.866 When theta = 150, diffX = sin(150) = 0.5 diffZ = cos(150) = -0.866 <- negative Hence, the position won't be the same. In a circle loop, its possible to get same value of each x and z for more than twice. Check the cosine and sine graph and you will know it Math xD