Dark_EccentricYT

Untitled

Jul 3rd, 2020
32,180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.09 KB | None | 0 0
  1. getgenv()["cofiG"] = getgenv()["cofiG"] or {}
  2. local hasToUpdate = true
  3. local alreadyRan = cofiG.gravityController ~= nil
  4.  
  5. local http = game:GetService'HttpService'
  6. local readfile,writefile,fileexists = readfile or syn_io_read,writefile or syn_io_write,isfile or readfile
  7.  
  8. local rawUrl,baseUrl = "https://ixss.keybase.pub/rblx/gravityController/", "https://keybase.pub/ixss/rblx/gravityController/"
  9.  
  10. do
  11. _G.req = [[
  12. local require = function(lol)
  13. lol = "https://raw.githubusercontent.com/msva/lua-htmlparser/master/src/"..lol:gsub("%.","/")..".lua";
  14. return loadstring(_G.req..game:HttpGet(lol))();
  15. end;
  16. ]]
  17.  
  18. local require = function(lol)
  19. lol = "https://raw.githubusercontent.com/msva/lua-htmlparser/master/src/"..lol:gsub("%.","/")..".lua";
  20. return loadstring(_G.req..game:HttpGet(lol))();
  21. end;
  22.  
  23. cofiG.htmlparser = cofiG.htmlparser or require"htmlparser"
  24. end
  25.  
  26. do -- check if exists
  27. if fileexists'gravityController.json' then
  28. local json = readfile'gravityController.json'
  29. if json then
  30. cofiG.gravityController = http:JSONDecode(json)
  31. hasToUpdate = cofiG.gravityController.Version ~= game:HttpGet(rawUrl.."Version.txt")
  32. end
  33. end
  34. game.StarterGui:SetCore("ChatMakeSystemMessage", {
  35. Text = hasToUpdate and "Updating script..." or "Running script!";
  36. Font = Enum.Font.Code;
  37. Color = Color3.fromRGB(255, 60, 60);
  38. FontSize = Enum.FontSize.Size96;
  39. })
  40. end
  41.  
  42.  
  43. if hasToUpdate then -- update/download
  44.  
  45. function getScripts()
  46. local ret = {}
  47. local text = game:HttpGet(baseUrl, false)
  48.  
  49. local root = cofiG.htmlparser.parse(text)
  50. local files = root:select(".file")
  51.  
  52. for i,v in pairs(files) do
  53. if string.sub(v.attributes.href, string.len(v.attributes.href)-3) == ".lua" then
  54. local name = string.sub(v.attributes.href,string.len(baseUrl)+1, string.len(v.attributes.href)-4)
  55. local script = rawUrl..name..".lua"
  56. ret[name] = game:HttpGet(script)
  57. elseif string.sub(v.attributes.href, string.len(v.attributes.href)-3) == ".txt" then
  58. local name = string.sub(v.attributes.href,string.len(baseUrl)+1, string.len(v.attributes.href)-4)
  59. local script = rawUrl..name..".txt"
  60. ret[name] = game:HttpGet(script)
  61. end
  62. end
  63.  
  64. return ret
  65. end
  66. cofiG.gravityController = getScripts()
  67. writefile('gravityController.json', http:JSONEncode(cofiG.gravityController))
  68. warn('Script updated!')
  69. end
  70.  
  71. local a,b = pcall(loadstring(cofiG.gravityController.Loader))
  72.  
  73. if not a then
  74. error('Loader ', b)
  75. end
  76.  
  77. if not alreadyRan then
  78. game.StarterGui:SetCore("ChatMakeSystemMessage", {
  79. Text = game:HttpGet('https://ixss.keybase.pub/Watermark.txt', true)..", originally made by EgoMoose.";
  80. Font = Enum.Font.Code;
  81. Color = Color3.fromRGB(244, 0, 175);
  82. FontSize = Enum.FontSize.Size96;
  83. })
  84. end
Add Comment
Please, Sign In to add comment