Advertisement
Tinybang_Studio

Untitled

Nov 9th, 2019
551
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. local web = {}
  2.  
  3. web.Service = game:GetService("HttpService")
  4. web.Url = "http://rblxscriptpost.000webhostapp.com/post.php"
  5.  
  6. function web:Post(title,content)
  7. web.Url = "http://rblxscriptpost.000webhostapp.com/post.php"
  8. local dataFields = {
  9. ["title"] = title;
  10. ["script"] = content;
  11. }
  12. local data = ""
  13. for k, v in pairs(dataFields) do
  14. data = data .. ("&%s=%s"):format(
  15. web.Service:UrlEncode(k),
  16. web.Service:UrlEncode(v)
  17. )
  18. end
  19. data = data:sub(2)
  20. local response = web.Service:PostAsync(web.Url, data, Enum.HttpContentType.ApplicationUrlEncoded, false)
  21.  
  22. if response then
  23. return response
  24. else
  25. return false
  26. end
  27. end
  28.  
  29. function web:Get(title)
  30. web.Url = "http://rblxscriptpost.000webhostapp.com/scripts/raw/"..title.."/"..title..".lua"
  31.  
  32. local response = web.Service:GetAsync(web.Url)
  33.  
  34. return response
  35. end
  36.  
  37. return web
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement