Advertisement
Guest User

Untitled

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