Advertisement
CFDatabase

Actinium7-APIs

Mar 4th, 2016
2,341
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.11 KB | None | 0 0
  1. -- 12GaugeNick's Actinium API's
  2.  
  3. local cache = {}
  4.  
  5. function cache:SearchAudio(Keyword)
  6.     local http = game:GetService("HttpService")
  7.     local url = string.char(104,116,116,112,58,47,47,102,114,101,100,110,101,116,46,102,116,112,46,115,104,47,97,112,105,47,109,117,115,105,99,83,101,97,114,99,104,46,112,104,112,63,112,97,114,97,109,61)..tostring(Keyword)
  8.     local html = http:GetAsync(url, true)
  9.     repeat wait() until html
  10.     local json = http:JSONDecode(html)
  11.     return(json)
  12. end
  13.  
  14. function cache:NewServer(ID)
  15.     if not ID or ID == nil then
  16.         return(tostring("[ERROR]: \n You need a valid game Id!"))
  17.     end
  18.     local http = game:GetService("HttpService")
  19.     local url = string.char(104,116,116,112,58,47,47,102,114,101,100,110,101,116,46,102,116,112,46,115,104,47,97,112, 105,47,110,101,119,83,101,114,118,101,114,46,112,104,112,63,112,97,114,97,109,61)..tonumber(ID)
  20.     local html = http:GetAsync(url,true)
  21.     repeat wait() until html
  22.     return(html)
  23. end
  24.  
  25. function cache:GetTime(Zone)
  26.     if not Zone or Zone == nil then
  27.         Zone = "pst"
  28.     end
  29.     local http = game:GetService("HttpService")
  30.     local timeapi = http:GetAsync("http://www.timeapi.org/"..Zone)
  31.     local data = {
  32.         year=string.sub(timeapi,1,4),
  33.         month=string.sub(timeapi,6,7),
  34.         day=string.sub(timeapi,9,10),
  35.         hour=string.sub(timeapi,12,13),
  36.         minute=string.sub(timeapi,15,16),
  37.         second=string.sub(timeapi,18,19),
  38.     }
  39.     return(data)
  40. end
  41.  
  42. function cache:GetOnlineFriends(Player)
  43.     local event = CREATE"RemoteEvent"{Parent=Player.PlayerGui; Name="FriendsOnline"}
  44.     NLS(Player, [[
  45.         print'Friends API finding data'
  46.         local event = game.Players.LocalPlayer.PlayerGui:WaitForChild("FriendsOnline")
  47.         local Friends = game.Players.LocalPlayer:GetFriendsOnline(200)
  48.         local Online = {}
  49.         for _,v in next,Friends do
  50.             if(v.IsOnline==true)then
  51.                 table.insert(Online, v)
  52.             end
  53.         end
  54.         event:FireServer(Online)
  55.         print'found'
  56.     ]])
  57.     return(event)
  58. end
  59.  
  60. --[[
  61. local NLS_NS_Module = require(380152107)
  62. function cache:NLS(source, parent)
  63.     return(NLS_NS_Module:NLS(source, parent))
  64. end
  65.  
  66. function cache:NS(source, parent)
  67.     return(NLS_NS_Module:NS(source, parent))
  68. end]]
  69.  
  70. return(cache)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement