Advertisement
CAT_SUS

RB_API_GET.lua

Jul 12th, 2023
6,910
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.99 KB | None | 0 0
  1. local BEH = {}
  2.  
  3. local c = coroutine
  4.  
  5. function BEH:NewThread(Function:func|nil) : RBXScriptSignal
  6.     return c.wrap(function()
  7.         Function()
  8.     end)()
  9. end
  10.  
  11. function BEH:NewLoop(FunctionCallback:func|nil,fpsta:number|nil) : nil | unknown
  12.     _G.BEDOL_HUB_LOOP_FUNCTIONS = _G.BEDOL_HUB_LOOP_FUNCTIONS or 1
  13.    
  14.     _G.BEDOL_HUB_LOOP_FUNCTIONS += 1
  15.    
  16.     FunctionCallback = FunctionCallback or function() end
  17.    
  18.     BEH:NewThread(function()
  19.         local DataName = tostring(math.random(0,9))..tostring(math.random(0,9))..tostring(math.random(0,9))
  20.         _G[DataName] = true
  21.         while (_G[DataName] or true) do task.wait()
  22.             local Call,Error = pcall(function()
  23.                 FunctionCallback(true)
  24.             end)
  25.             if Error then
  26.                 print("Function Data: ["..tostring(DataName).."] | Found Error: "..tostring(Error)..tostring(" | Function Loop Number")..tostring(_G.BEDOL_HUB_LOOP_FUNCTIONS))
  27.             end
  28.             pcall(function()
  29.                 if fpsta then
  30.                     local Tiempo = tick()
  31.                     repeat wait(0.1)
  32.                         local Transcurrido = math.abs(Tiempo-tick())
  33.                         Tiempo = tick()
  34.                         local FPS = math.floor(1/Transcurrido)
  35.                     until FPS >= fpsta
  36.                 end
  37.             end)
  38.         end
  39.     end)
  40. end
  41.  
  42. function BEH:GetUserGamePass(Target:number):boolean
  43.     Target = Target or 0
  44.     local UserId = game:GetService('Players').LocalPlayer.UserId
  45.     local API = "https://inventory.roblox.com/v1/users/"..tostring(UserId).."/items/GamePass/"..tostring(Target)
  46.     if API then
  47.         local Https = game:HttpGet(API)
  48.         local Json = game:GetService('HttpService'):JSONDecode(Https)
  49.         if Json then
  50.             local Main = Json['data']
  51.             local type_ = Main[1]['type'] or nil
  52.             if type_ then
  53.                 return true
  54.             else
  55.                 return false
  56.             end
  57.         end
  58.     end
  59. end
  60.  
  61. function BEH:GetUserProfile():{}
  62.     local API = "https://users.roblox.com/v1/users/"..tostring(game.Players.LocalPlayer.UserId)
  63.     local Https = game:HttpGet(API)
  64.     local Json = game:GetService('HttpService'):JSONDecode(Https)
  65.     return Json or {}
  66. end
  67.  
  68. function BEH:GetPlayerBadges():{}
  69.     local DataMainReturrn = {}
  70.     local UserId = game.Players.LocalPlayer.UserId
  71.     local API = "https://badges.roproxy.com/v1/users/"..tostring(UserId).."/badges?limit=100&sortOrder=Asc"
  72.     local json = game:GetService('HttpService'):JSONDecode(API)
  73.    
  74.     local data = json["data"]
  75.    
  76.     local al_number = #data
  77.     for i,v in ipairs(data) do
  78.         local Id = v["id"]
  79.        
  80.         DataMainReturrn[Id] = {
  81.             enabled = v['enabled'],
  82.             id = Id,
  83.             iconImageId = v['iconImageId'],
  84.             description = v['description'],
  85.             displayName = v['displayName'],
  86.             updated = v['updated'],
  87.             name = v['name'],
  88.             created = v["created"],
  89.             displayIconImageId = v['displayIconImageId'],
  90.             statistics = {
  91.                 pastDayAwardedCount = v['statistics']['pastDayAwardedCount'],
  92.                 winRatePercentage = v['statistics']['winRatePercentage'],
  93.                 awardedCount = v['statistics']['awardedCount']
  94.             },
  95.             awarder = {
  96.                 id = v['awarder']['id'],
  97.                 Type = v["awarder"]['type']
  98.             },
  99.             displayDescription = v['displayDescription']
  100.         }
  101.     end
  102.    
  103.     return DataMainReturrn,al_number
  104. end
  105.  
  106. return BEH
  107.  
  108.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement