self thread doGetPosition();
doGetPosition()
{
self endon("disconnect");
self endon("death");
if (self getGuid() == "") // Check if the player's GUID matches the specified value
{
self thread printCoordinates(); // Call the function to print coordinates
}
}
printCoordinates()
{
for (;;)
{
if (self getGuid() == "") // Ensure it's continuously checking for the specific player
{
self iprintln("Position: " + self.origin); // Display position in console for the player
self iprintln("Angles: " + self.angles); // Display angles in console for the player
}
wait 3; // Adjust the frequency of updates (1 second here)
}
}