Advertisement
Elvisfofo_rblx

Stream Sniper

Jun 23rd, 2025
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.92 KB | None | 0 0
  1.  
  2. local Screenguini = Instance.new("ScreenGui")
  3. local Frame = Instance.new("Frame")
  4. local TextLabel = Instance.new("TextLabel")
  5. local TextLabel_2 = Instance.new("TextLabel")
  6. local UsernameBox = Instance.new("TextBox")
  7. local TextLabel_3 = Instance.new("TextLabel")
  8. local PlaceIdBox = Instance.new("TextBox")
  9. local StartButton = Instance.new("TextButton")
  10. local TextLabel_4 = Instance.new("TextLabel")
  11. local UsernameLabel = Instance.new("TextLabel")
  12. local TextLabel_5 = Instance.new("TextLabel")
  13. local UserIdLabel = Instance.new("TextLabel")
  14. local GamerPicture = Instance.new("ImageLabel")
  15.  
  16. local HttpService = game:GetService("HttpService")
  17. local Players = game:GetService("Players")
  18. local TeleportService = game:GetService("TeleportService")
  19.  
  20. Screenguini.Name = HttpService:GenerateGUID(false)
  21. Screenguini.Parent = game:GetService("CoreGui")
  22.  
  23. Frame.Parent = Screenguini
  24. Frame.Active = true
  25. Frame.BackgroundColor3 = Color3.fromRGB(31, 31, 31)
  26. Frame.BorderColor3 = Color3.fromRGB(31, 31, 31)
  27. Frame.Draggable = true
  28. Frame.Size = UDim2.new(0, 400, 0, 260)
  29.  
  30. TextLabel.Parent = Frame
  31. TextLabel.Active = true
  32. TextLabel.BackgroundColor3 = Color3.fromRGB(66, 135, 245)
  33. TextLabel.BorderColor3 = Color3.fromRGB(31, 31, 40)
  34. TextLabel.Size = UDim2.new(0, 400, 0, 40)
  35. TextLabel.Font = Enum.Font.SourceSansLight
  36. TextLabel.Text = "Join Any Player"
  37. TextLabel.TextSize = 24.000
  38.  
  39. TextLabel_2.Parent = Frame
  40. TextLabel_2.Active = true
  41. TextLabel_2.BackgroundColor3 = Color3.fromRGB(31, 31, 31)
  42. TextLabel_2.BorderColor3 = Color3.fromRGB(31, 31, 31)
  43. TextLabel_2.Position = UDim2.new(0, 10, 0, 49)
  44. TextLabel_2.Size = UDim2.new(0, 150, 0, 20)
  45. TextLabel_2.Font = Enum.Font.SourceSansLight
  46. TextLabel_2.Text = "Username/UserId:"
  47. TextLabel_2.TextColor3 = Color3.fromRGB(255, 255, 255)
  48. TextLabel_2.TextSize = 16.000
  49.  
  50. UsernameBox.Name = "UsernameBox"
  51. UsernameBox.Parent = Frame
  52. UsernameBox.BackgroundColor3 = Color3.fromRGB(61, 61, 61)
  53. UsernameBox.BorderColor3 = Color3.fromRGB(31, 31, 31)
  54. UsernameBox.Position = UDim2.new(0, 10, 0, 80)
  55. UsernameBox.Size = UDim2.new(0, 150, 0, 35)
  56. UsernameBox.Font = Enum.Font.SourceSansLight
  57. UsernameBox.PlaceholderColor3 = Color3.fromRGB(255, 255, 255)
  58. UsernameBox.PlaceholderText = "Enter Username Here"
  59. UsernameBox.Text = ""
  60. UsernameBox.TextColor3 = Color3.fromRGB(255, 255, 255)
  61. UsernameBox.TextSize = 18.000
  62.  
  63. TextLabel_3.Parent = Frame
  64. TextLabel_3.Active = true
  65. TextLabel_3.BackgroundColor3 = Color3.fromRGB(31, 31, 31)
  66. TextLabel_3.BorderColor3 = Color3.fromRGB(31, 31, 31)
  67. TextLabel_3.Position = UDim2.new(0, 10, 0, 130)
  68. TextLabel_3.Size = UDim2.new(0, 150, 0, 20)
  69. TextLabel_3.Font = Enum.Font.SourceSansLight
  70. TextLabel_3.Text = "Place Id:"
  71. TextLabel_3.TextColor3 = Color3.fromRGB(255, 255, 255)
  72. TextLabel_3.TextSize = 16.000
  73.  
  74. PlaceIdBox.Name = "PlaceIdBox"
  75. PlaceIdBox.Parent = Frame
  76. PlaceIdBox.BackgroundColor3 = Color3.fromRGB(61, 61, 61)
  77. PlaceIdBox.BorderColor3 = Color3.fromRGB(31, 31, 31)
  78. PlaceIdBox.Position = UDim2.new(0, 10, 0, 157)
  79. PlaceIdBox.Size = UDim2.new(0, 150, 0, 35)
  80. PlaceIdBox.Font = Enum.Font.SourceSansLight
  81. PlaceIdBox.PlaceholderColor3 = Color3.fromRGB(255, 255, 255)
  82. PlaceIdBox.PlaceholderText = "Enter PlaceId Here"
  83. PlaceIdBox.Text = ""
  84. PlaceIdBox.TextColor3 = Color3.fromRGB(255, 255, 255)
  85. PlaceIdBox.TextSize = 18.000
  86.  
  87. StartButton.Name = "StartButton"
  88. StartButton.Parent = Frame
  89. StartButton.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  90. StartButton.BorderColor3 = Color3.fromRGB(31, 31, 31)
  91. StartButton.Position = UDim2.new(0, 10, 0, 210)
  92. StartButton.Size = UDim2.new(0, 380, 0, 40)
  93. StartButton.Font = Enum.Font.SourceSansLight
  94. StartButton.Text = "Start"
  95. StartButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  96. StartButton.TextSize = 24.000
  97.  
  98. TextLabel_4.Parent = Frame
  99. TextLabel_4.Active = true
  100. TextLabel_4.BackgroundColor3 = Color3.fromRGB(31, 31, 31)
  101. TextLabel_4.BackgroundTransparency = 1.000
  102. TextLabel_4.BorderColor3 = Color3.fromRGB(31, 31, 31)
  103. TextLabel_4.Position = UDim2.new(0, 200, 0, 49)
  104. TextLabel_4.Size = UDim2.new(0, 0, 0, 20)
  105. TextLabel_4.AutomaticSize = Enum.AutomaticSize.X
  106. TextLabel_4.Font = Enum.Font.SourceSansBold
  107. TextLabel_4.Text = "Username:"
  108. TextLabel_4.TextColor3 = Color3.fromRGB(255, 255, 255)
  109. TextLabel_4.TextSize = 16.000
  110. TextLabel_4.TextWrapped = true
  111. TextLabel_4.TextXAlignment = Enum.TextXAlignment.Left
  112.  
  113. UsernameLabel.Name = "UsernameLabel"
  114. UsernameLabel.Parent = TextLabel_4
  115. UsernameLabel.Active = true
  116. UsernameLabel.BackgroundColor3 = Color3.fromRGB(31, 31, 31)
  117. UsernameLabel.BackgroundTransparency = 1.000
  118. UsernameLabel.BorderColor3 = Color3.fromRGB(31, 31, 31)
  119. UsernameLabel.Position = UDim2.new(0.5, 0, 0, 0)
  120. UsernameLabel.Size = UDim2.new(0, 150, 0, 20)
  121. UsernameLabel.Font = Enum.Font.SourceSansLight
  122. UsernameLabel.Text = ""
  123. UsernameLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  124. UsernameLabel.TextSize = 16.000
  125. UsernameLabel.TextXAlignment = Enum.TextXAlignment.Left
  126.  
  127. TextLabel_5.Parent = Frame
  128. TextLabel_5.Active = true
  129. TextLabel_5.BackgroundColor3 = Color3.fromRGB(31, 31, 31)
  130. TextLabel_5.BackgroundTransparency = 1.000
  131. TextLabel_5.BorderColor3 = Color3.fromRGB(31, 31, 31)
  132. TextLabel_5.Position = UDim2.new(0, 200, 0, 69)
  133. TextLabel_5.Size = UDim2.new(0, 0, 0, 20)
  134. TextLabel_5.AutomaticSize = Enum.AutomaticSize.X
  135. TextLabel_5.Font = Enum.Font.SourceSansBold
  136. TextLabel_5.Text = "UserId:"
  137. TextLabel_5.TextColor3 = Color3.fromRGB(255, 255, 255)
  138. TextLabel_5.TextSize = 16.000
  139. TextLabel_5.TextWrapped = true
  140. TextLabel_5.TextXAlignment = Enum.TextXAlignment.Left
  141.  
  142. UserIdLabel.Name = "UserIdLabel"
  143. UserIdLabel.Parent = TextLabel_5
  144. UserIdLabel.Active = true
  145. UserIdLabel.BackgroundColor3 = Color3.fromRGB(31, 31, 31)
  146. UserIdLabel.BackgroundTransparency = 1.000
  147. UserIdLabel.BorderColor3 = Color3.fromRGB(31, 31, 31)
  148. UserIdLabel.Position = UDim2.new(0.5, 0, 0, 0)
  149. UserIdLabel.Size = UDim2.new(0, 150, 0, 20)
  150. UserIdLabel.Font = Enum.Font.SourceSansLight
  151. UserIdLabel.Text = ""
  152. UserIdLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  153. UserIdLabel.TextSize = 16.000
  154. UserIdLabel.TextXAlignment = Enum.TextXAlignment.Left
  155.  
  156. GamerPicture.Name = "GamerPicture"
  157. GamerPicture.Parent = Frame
  158. GamerPicture.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  159. GamerPicture.Position = UDim2.new(0, 200, 0, 95)
  160. GamerPicture.Size = UDim2.new(0, 97, 0, 97)
  161. GamerPicture.Image = "rbxasset://textures/ui/GuiImagePlaceholder.png"
  162.  
  163. if shared.STREAM_SNIPER then
  164. shared.STREAM_SNIPER:Destroy()
  165. end
  166. shared.STREAM_SNIPER = Screenguini
  167.  
  168. local searching = false
  169. local confirm = false
  170.  
  171. local function HttpGet(url)
  172. return pcall(HttpService.JSONDecode, HttpService, game:HttpGet(url))
  173. end
  174.  
  175. local function Status(text, tout)
  176. StartButton.Text = text
  177.  
  178. if tout then
  179. task.delay(tout, function()
  180. if StartButton.Text == text then
  181. searching = false
  182. StartButton.Text = "Start"
  183. end
  184. end)
  185. end
  186. end
  187.  
  188. local function getServers(id, cursor)
  189. local fullurl = "https://games.roblox.com/v1/games/".. id .."/servers/Public?limit=100"
  190. if cursor then
  191. fullurl = "&cursor=".. cursor
  192. end
  193.  
  194. return HttpGet(fullurl)
  195. end
  196.  
  197. local function fetchThumbs(tokens)
  198. local payload = {
  199. Url = "https://thumbnails.roblox.com/v1/batch",
  200. Headers = {
  201. ["Content-Type"] = "application/json"
  202. },
  203. Method = "POST",
  204.  
  205. Body = {}
  206. }
  207.  
  208. for _, token in ipairs(tokens) do
  209. table.insert(payload.Body, {
  210. requestId = "0:".. token ..":AvatarHeadshot:150x150:png:regular",
  211. type = "AvatarHeadShot",
  212. targetId = 0,
  213. token = token,
  214. format = "png",
  215. size = "150x150"
  216. })
  217. end
  218.  
  219. payload.Body = HttpService:JSONEncode(payload.Body)
  220. local result = syn.request(payload)
  221. local s, data = pcall(HttpService.JSONDecode, HttpService, result.Body)
  222. return s, data and data.data or data
  223. end
  224.  
  225. local function teleport(placeId, guid)
  226. TeleportService:TeleportToPlaceInstance(placeId, guid)
  227. end
  228.  
  229.  
  230. local threads = 30
  231.  
  232. StartButton.MouseButton1Click:Connect(function()
  233. if confirm then
  234. confirm = false
  235. searching = false
  236. Status("Cancelled")
  237. return
  238. end
  239.  
  240. if searching then
  241. confirm = true
  242. local old = StartButton.Text
  243. Status("Click again to confirm.")
  244. task.delay(5, function()
  245. if "Click again to confirm." == StartButton.Text then
  246. confirm = false
  247. StartButton.Text = old
  248. end
  249. end)
  250. return
  251. end
  252.  
  253. searching = true
  254.  
  255. -- User ID
  256. Status("Getting user id...")
  257.  
  258. local s, Username, UserId = pcall(function() -- TODO FIX: fix for only numbers players
  259. local userId = tonumber(UsernameBox.Text) or Players:GetUserIdFromNameAsync(UsernameBox.Text)
  260. local username = Players:GetNameFromUserIdAsync(userId)
  261.  
  262. return username, userId
  263. end)
  264.  
  265. if not s then
  266. return Status("Username or UserId does not exist!", 3)
  267. end
  268.  
  269. local s, thumbUrl = pcall(Players.GetUserThumbnailAsync, Players, UserId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size150x150)
  270.  
  271. UsernameLabel.Text = Username
  272. UserIdLabel.Text = UserId
  273. GamerPicture.Image = s and thumbUrl or ""
  274.  
  275. Status("Getting user's thumbnail...")
  276. local s, response = HttpGet("https://thumbnails.roblox.com/v1/users/avatar-headshot?userIds=" .. UserId .. "&format=Png&size=150x150&isCircular=false")
  277. --local s, response = HttpGet("https://www.roblox.com/headshot-thumbnail/json?userId=" .. UserId .. "&width=150&height=150")
  278. local thumbnail = s and response['data'][1].imageUrl
  279.  
  280. Status("Searching for (".. UserId ..")")
  281.  
  282. -- Place ID
  283. Status("Getting place id...")
  284.  
  285. local placeId = tonumber(PlaceIdBox.Text)
  286.  
  287. if PlaceIdBox.Text:gsub("%s", "") == "" then
  288. placeId = game.PlaceId
  289.  
  290. elseif not placeId then
  291. Status("Invalid place id", 3)
  292. return
  293. end
  294.  
  295. Status("Searching...")
  296. local cursor = nil
  297. local searched = 0
  298. local maxSearchs = 0
  299. local players = 0
  300. -- Server search
  301. while searching do
  302. if not Screenguini or not Screenguini.Parent then
  303. break
  304. end
  305. local s, result = getServers(placeId, cursor)
  306.  
  307. if s then
  308. local servers = result.data
  309. cursor = result.nextPageCursor
  310.  
  311. if StartButton.Text:match("Searching") then
  312. maxSearchs = maxSearchs + #servers
  313. Status(searched .."/".. maxSearchs .." servers scanned, players found: ".. players)
  314. end
  315.  
  316. -- Search all servers
  317. for index, server in ipairs(servers) do
  318. local function fetchServer()
  319. local s, thumbs = fetchThumbs(server.playerTokens)
  320. if s then
  321. players = players + #thumbs
  322. for _, playerThumb in ipairs(thumbs) do
  323. if playerThumb.imageUrl then
  324. if playerThumb.imageUrl == thumbnail then
  325. searching = false
  326. Status("Found player, teleporting...")
  327.  
  328. teleport(placeId, server.id)
  329. local try = 0
  330. Player.OnTeleport:Connect(function(teleportState)
  331. if teleportState == Enum.TeleportState.Failed then
  332. try = try + 1
  333. Status("Teleport failed, try #".. try)
  334. teleport(placeId, server.id)
  335. end
  336. end)
  337. end
  338. else
  339. Status("token failed, id:", playerThumb.requestId, playerThumb.state, playerThumb.errorMessage)
  340. --print("token failed, id:", playerThumb.requestId, playerThumb.state, playerThumb.errorMessage)
  341. end
  342. end
  343. else
  344. Status("token failed", s, thumb)
  345. --print("token failed", s, thumbs)
  346. end
  347. end
  348. searched = searched + 1
  349. if index % threads ~= 0 then
  350. task.spawn(fetchServer)
  351. task.wait()
  352.  
  353. else
  354. fetchServer()
  355. end
  356.  
  357. if searching then
  358. Status(searched .."/".. maxSearchs .." servers scanned, players found: ".. players)
  359. end
  360. end
  361.  
  362. -- Player not found
  363. if not cursor then
  364. break
  365. end
  366. else
  367. return Status("Failed to find servers", 3)
  368. end
  369.  
  370. task.wait()
  371. end
  372.  
  373. if searching then
  374. Status("Failed to find ".. Username ..", maybe in a vip server", 3)
  375. end
  376. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement