Meliodas0_0

remove all online friends

Feb 2nd, 2020
470
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local id = game.Players.LocalPlayer.UserId
  2. local plr = game.Players.LocalPlayer
  3. local http = game:GetService("HttpService")
  4. local frends = game:HttpGet(('https://friends.roblox.com/v1/users/'..id..'/friends'),true)
  5. --[[
  6. local txt = frends
  7. for i=1,10 do
  8. local i,n = string.find(txt, '{"id":')
  9. print(i,n) --> 1 5
  10. print(string.sub(txt, n+1, n+10)) --> hello
  11. local len = txt:len()
  12. txt = string.sub(txt,n+10,len)
  13. --print(tonumber(string.sub(txt, n+1, n+10)))
  14. end--]]
  15. --Was trying to make a list of user ids but remember GetFriendsOnline() existed xd
  16.  
  17. local e = plr:GetFriendsOnline(200)
  18. print(tostring(e))
  19. for i,friend in pairs(e) do
  20. print(friend.UserName)
  21. print(' ... ')
  22. local unf = 'https://friends.roblox.com/v1/users/'..friend.VisitorId..'/unfriend'
  23. game:HttpPost(unf,'{}')
  24. print(friend.UserName.." got yeeted")
  25. end
RAW Paste Data