Last active
February 15, 2023 21:09
-
-
Save Apearson75/83887438593ef0bc6b45c1f9542969ac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ******************************************************* */ | |
/* Roblox Player Follow */ | |
/* ******************************************************* */ | |
const kreek = 140258990; | |
async function searchPlayer(userID, gameID) { | |
const userReq = await fetch(`https://thumbnails.roblox.com/v1/users/avatar-headshot?userIds=${userID}&size=48x48&format=Png&isCircular=false`); | |
const userJSON = await userReq.json(); | |
const userImg = userJSON.data[0].imageUrl; | |
console.log(`Finding: ${userImg}`); | |
let cursor = ""; | |
let e = true; | |
let count = 0; | |
let serverID; | |
while (e) { | |
try { | |
let serverReq; | |
if (cursor === "") { | |
serverReq = await fetch(`https://games.roblox.com/v1/games/${gameID}/servers/0?sortOrder=2&excludeFullGames=false&limit=100`); | |
} else { | |
serverReq = await fetch(`https://games.roblox.com/v1/games/${gameID}/servers/0?sortOrder=2&excludeFullGames=false&limit=100&cursor=${cursor}`); | |
} | |
const serverJSON = await serverReq.json(); | |
cursor = serverJSON.nextPageCursor; | |
serverJSON.data.forEach(server => { | |
server.playerTokens.forEach(async token => { | |
const pfpreq = await window.RobloxThumbnails.thumbnailService.getThumbnailImage('AvatarHeadshot', '48x48', 'png', 0, token); | |
const pfpUrl = pfpreq.thumbnail.imageUrl; | |
if (pfpUrl == userImg) { | |
console.log("Found"); | |
serverID = server.id; | |
Roblox.GameLauncher.joinGameInstance(gameID, serverID); | |
e = false; | |
return; | |
} | |
}); | |
}); | |
if (cursor == null) | |
console.log("A"); | |
} | |
catch (e) {} | |
count++; | |
console.log(`Tried ${count} time(s)`); | |
} | |
console.log("Nope"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment