Advertisement
killerbrenden

Roblox Studio

Dec 6th, 2020
837
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.60 KB | None | 0 0
  1. local api = {}
  2.  
  3. local https = game:GetService("HttpService")
  4.  
  5. local base = "https://commandapi.glitch.me/"
  6. local get = "getCommands"
  7. local post = "postCommand/"
  8.  
  9. function api.GET()
  10.     local s, e = pcall(function()
  11.         local request = https:RequestAsync({
  12.             Url = base..get,
  13.             Method = "GET"
  14.         })
  15.     end)
  16.    
  17.     if s then
  18.         return e
  19.     else
  20.         return warn(e)
  21.     end
  22. end
  23.  
  24. function api.POST(cmd)
  25.     local s, e = pcall(function()
  26.         local request = https:RequestAsync({
  27.             Url = base..post..cmd,
  28.             Method = "POST"
  29.         })
  30.     end)
  31.  
  32.     if s then
  33.         return e
  34.     else
  35.         return warn(e)
  36.     end
  37. end
  38.  
  39. return api
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement