I used this method when making this: alphabot22/Automatic-Roblox-Cursor-Change: Change your roblox cursor automatically (github.com)
using System;
using System.IO;
using System.Threading;
using System.Linq;
public static string GetNewestDirectory(string path)
{
var directory = new DirectoryInfo(path).GetDirectories().OrderByDescending(o => o.CreationTime).FirstOrDefault();
return directory.Name;
}
static string GetRobloxVersion()
{
string userProfile = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
string roblox_version_path = userProfile + @"\AppData\Local\Roblox\Versions\";
string roblox_newest_version = GetNewestDirectory(roblox_version_path);
string roblox_newest_version_path = roblox_version_path + roblox_newest_version;
Thread.Sleep(2000);
return roblox_newest_version_path;
}⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀ ⠀⠀⠀⠀