kphs2

gugu

Sep 14th, 2024
1,096
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 32.89 KB | None | 0 0
  1. local bit = bit32
  2. function ToEnum(a)
  3. for i, v in pairs(Enum.KeyCode:GetEnumItems()) do if tostring(v) == a then return v end end
  4. end
  5. local Functions = {}
  6. local keys={[0x08]=Enum.KeyCode.Backspace,[0x09]=Enum.KeyCode.Tab,[0x0C]=Enum.KeyCode.Clear,[0x0D]=Enum.KeyCode.Return,[0x10]=Enum.KeyCode.LeftShift,[0x11]=Enum.KeyCode.LeftControl,[0x12]=Enum.KeyCode.LeftAlt,[0x13]=Enum.KeyCode.Pause,[0x14]=Enum.KeyCode.CapsLock,[0x1B]=Enum.KeyCode.Escape,[0x20]=Enum.KeyCode.Space,[0x21]=Enum.KeyCode.PageUp,[0x22]=Enum.KeyCode.PageDown,[0x23]=Enum.KeyCode.End,[0x24]=Enum.KeyCode.Home,[0x2D]=Enum.KeyCode.Insert,[0x2E]=Enum.KeyCode.Delete,[0x30]=Enum.KeyCode.Zero,[0x31]=Enum.KeyCode.One,[0x32]=Enum.KeyCode.Two,[0x33]=Enum.KeyCode.Three,[0x34]=Enum.KeyCode.Four,[0x35]=Enum.KeyCode.Five,[0x36]=Enum.KeyCode.Six,[0x37]=Enum.KeyCode.Seven,[0x38]=Enum.KeyCode.Eight,[0x39]=Enum.KeyCode.Nine,[0x41]=Enum.KeyCode.A,[0x42]=Enum.KeyCode.B,[0x43]=Enum.KeyCode.C,[0x44]=Enum.KeyCode.D,[0x45]=Enum.KeyCode.E,[0x46]=Enum.KeyCode.F,[0x47]=Enum.KeyCode.G,[0x48]=Enum.KeyCode.H,[0x49]=Enum.KeyCode.I,[0x4A]=Enum.KeyCode.J,[0x4B]=Enum.KeyCode.K,[0x4C]=Enum.KeyCode.L,[0x4D]=Enum.KeyCode.M,[0x4E]=Enum.KeyCode.N,[0x4F]=Enum.KeyCode.O,[0x50]=Enum.KeyCode.P,[0x51]=Enum.KeyCode.Q,[0x52]=Enum.KeyCode.R,[0x53]=Enum.KeyCode.S,[0x54]=Enum.KeyCode.T,[0x55]=Enum.KeyCode.U,[0x56]=Enum.KeyCode.V,[0x57]=Enum.KeyCode.W,[0x58]=Enum.KeyCode.X,[0x59]=Enum.KeyCode.Y,[0x5A]=Enum.KeyCode.Z,[0x5D]=Enum.KeyCode.Menu,[0x60]=Enum.KeyCode.KeypadZero,[0x61]=Enum.KeyCode.KeypadOne,[0x62]=Enum.KeyCode.KeypadTwo,[0x63]=Enum.KeyCode.KeypadThree,[0x64]=Enum.KeyCode.KeypadFour,[0x65]=Enum.KeyCode.KeypadFive,[0x66]=Enum.KeyCode.KeypadSix,[0x67]=Enum.KeyCode.KeypadSeven,[0x68]=Enum.KeyCode.KeypadEight,[0x69]=Enum.KeyCode.KeypadNine,[0x6A]=Enum.KeyCode.KeypadMultiply,[0x6B]=Enum.KeyCode.KeypadPlus,[0x6D]=Enum.KeyCode.KeypadMinus,[0x6E]=Enum.KeyCode.KeypadPeriod,[0x6F]=Enum.KeyCode.KeypadDivide,[0x70]=Enum.KeyCode.F1,[0x71]=Enum.KeyCode.F2,[0x72]=Enum.KeyCode.F3,[0x73]=Enum.KeyCode.F4,[0x74]=Enum.KeyCode.F5,[0x75]=Enum.KeyCode.F6,[0x76]=Enum.KeyCode.F7,[0x77]=Enum.KeyCode.F8,[0x78]=Enum.KeyCode.F9,[0x79]=Enum.KeyCode.F10,[0x7A]=Enum.KeyCode.F11,[0x7B]=Enum.KeyCode.F12,[0x90]=Enum.KeyCode.NumLock,[0x91]=Enum.KeyCode.ScrollLock,[0xBA]=Enum.KeyCode.Semicolon,[0xBB]=Enum.KeyCode.Equals,[0xBC]=Enum.KeyCode.Comma,[0xBD]=Enum.KeyCode.Minus,[0xBE]=Enum.KeyCode.Period,[0xBF]=Enum.KeyCode.Slash,[0xC0]=Enum.KeyCode.Backquote,[0xDB]=Enum.KeyCode.LeftBracket,[0xDD]=Enum.KeyCode.RightBracket,[0xDE]=Enum.KeyCode.Quote}
  7. local funcs, names = {}, {}
  8. local c = 1
  9.  
  10. local vim = game:GetService('VirtualInputManager');
  11. function _BLANK() end
  12. function DescendantCount(tbl)
  13. local count = 0
  14. if type(tbl) ~= 'table' then
  15. return 1
  16. end
  17. for _, v in pairs(tbl) do
  18. count = count + 1
  19. if type(v) == 'table' then
  20. count = count + DescendantCount(v)
  21. end
  22. end
  23. return count
  24. end
  25.  
  26.  
  27. function Descendants(tbl)
  28. local descendants = {}
  29.  
  30. local function process_table(subtbl, prefix)
  31. for k, v in pairs(subtbl) do
  32. local index = prefix and (prefix .. "." .. tostring(k)) or tostring(k)
  33. descendants[index] = v -- Include the table itself
  34. if type(v) == 'table' then
  35. process_table(v, index)
  36. else
  37. descendants[index] = v
  38. end
  39. end
  40. end
  41.  
  42. if type(tbl) ~= 'table' then
  43. descendants[tostring(1)] = tbl
  44. else
  45. process_table(tbl, nil)
  46. end
  47.  
  48. return descendants
  49. end
  50.  
  51.  
  52.  
  53.  
  54. local Debug = loadstring(game:HttpGet('https://rawscripts.net/raw/Universal-Script-Basic-Functions-12707'))()
  55.  
  56. --[[ Libraries ]]
  57.  
  58.  
  59. funcs.base64 = {}
  60. funcs.crypt = {hex={},url={}}
  61. funcs.syn = {}
  62. funcs.syn_backup = {}
  63. funcs.http = {}
  64. funcs.Drawing = {}
  65. funcs.Vector2 = table.clone(Vector2) -- [[ Extra vector2 functions for scaling. ]]
  66.  
  67. funcs.Drawing.Fonts = {
  68. ['UI'] = 0,
  69. ['System'] = 1,
  70. ['Plex'] = 2,
  71. ['Monospace'] = 3
  72. }
  73. local Fonts = {
  74. [0] = Enum.Font.Arial,
  75. [1] = Enum.Font.BuilderSans,
  76. [2] = Enum.Font.Gotham,
  77. [3] = Enum.Font.RobotoMono
  78. }
  79.  
  80. local drawingHistory = {}
  81. local DrawingDict = Instance.new("ScreenGui")
  82.  
  83. -- [[ Functions ]]
  84. funcs.Vector2.rel = function(x, y)
  85. local size = workspace.CurrentCamera.ViewportSize
  86. return Vector2.new(size.X * x, size.Y * y)
  87. end
  88. funcs.Vector2.relx = function(x)
  89. return workspace.CurrentCamera.ViewportSize.X * x
  90. end
  91. funcs.Vector2.rely = function(y)
  92. return workspace.CurrentCamera.ViewportSize.Y * y
  93. end
  94. funcs.Vector2.fromRel = funcs.Vector2.rel
  95. funcs.Vector2.scale = funcs.Vector2.rel
  96. funcs.Vector2.fromScale = funcs.Vector2.rel
  97.  
  98. funcs.clonefunction = function(a)
  99. return function(...)
  100. return a(...)
  101. end
  102. end
  103. funcs.cloneref = function(a) -- [[ Not a real cloneref but works]
  104. local s, _ = pcall(function() return a:Clone() end) return s and _ or a
  105. end
  106. funcs.deepclone = function(a)
  107. local Result = {}
  108. for i, v in pairs(a) do
  109. if type(v) == 'table' then
  110. Result[i] = funcs.deepclone(v)
  111. end
  112. Result[i] = v
  113. end
  114. return Result
  115. end
  116. getgenv = getgenv or getfenv(2)
  117. function SafeOverride(a, b, c) --[[ Index, Data, Should override ]]
  118. if getgenv()[a] and not c then return 1 end
  119. getgenv()[a] = b
  120. return 2
  121. end
  122. --[[ The base64 functions were made by https://scriptblox.com/u/yofriendfromschool1 , Credits to him.]]
  123. funcs.base64.encode = function(data)
  124. local letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
  125. return ((data:gsub('.', function(x)
  126. local r,b='',x:byte()
  127. for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end
  128. return r;
  129. end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x)
  130. if (#x < 6) then return '' end
  131. local c=0
  132. for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end
  133. return letters:sub(c+1,c+1)
  134. end)..({ '', '==', '=' })[#data%3+1])
  135. end
  136. funcs.base64.decode = function(data)
  137. local b = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
  138. data = string.gsub(data, '[^'..b..'=]', '')
  139. return (data:gsub('.', function(x)
  140. if x == '=' then return '' end
  141. local r, f = '', (b:find(x) - 1)
  142. for i = 6, 1, -1 do
  143. r = r .. (f % 2^i - f % 2^(i - 1) > 0 and '1' or '0')
  144. end
  145. return r;
  146. end):gsub('%d%d%d?%d?%d?%d?%d?%d?', function(x)
  147. if #x ~= 8 then return '' end
  148. local c = 0
  149. for i = 1, 8 do
  150. c = c + (x:sub(i, i) == '1' and 2^(8 - i) or 0)
  151. end
  152. return string.char(c)
  153. end))
  154. end
  155.  
  156. funcs.loadstring = loadstring
  157. funcs.getgenv = getgenv
  158. funcs.crypt.base64 = funcs.base64
  159. funcs.crypt.base64encode = funcs.base64.encode
  160. funcs.crypt.base64decode = funcs.base64.decode
  161. funcs.crypt.base64_encode = funcs.base64.encode
  162. funcs.crypt.base64_decode = funcs.base64.decode
  163. funcs.base64_encode = funcs.base64.encode
  164. funcs.base64_decode = funcs.base64.decode
  165.  
  166. funcs.crypt.hex.encode = function(txt)
  167. txt = tostring(txt)
  168. local hex = ''
  169. for i = 1, #txt do
  170. hex = hex .. string.format("%02x", string.byte(txt, i))
  171. end
  172. return hex
  173. end
  174. funcs.crypt.hex.decode = function(hex)
  175. hex = tostring(hex)
  176. local text = ""
  177. for i = 1, #hex, 2 do
  178. local byte_str = string.sub(hex, i, i+1)
  179. local byte = tonumber(byte_str, 16)
  180. text = text .. string.char(byte)
  181. end
  182. return text
  183. end
  184. funcs.crypt.url.encode = function(a)
  185. return game:GetService("HttpService"):UrlEncode(a)
  186. end
  187. funcs.crypt.url.decode = function(a)
  188. a = tostring(a)
  189. a = string.gsub(a, "+", " ")
  190. a = string.gsub(a, "%%(%x%x)", function(hex)
  191. return string.char(tonumber(hex, 16))
  192. end)
  193. a = string.gsub(a, "\r\n", "\n")
  194. return a
  195. end
  196. funcs.crypt.generatekey = function(optionalSize)
  197. local key = ''
  198. local a = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
  199. for i = 1, optionalSize or 32 do local n = math.random(1, #a) key = key .. a:sub(n, n) end
  200. return funcs.base64.encode(key)
  201. end
  202. funcs.crypt.generatebytes = function(size)
  203. if type(size) ~= 'number' then return error('missing arguement #1 to \'generatebytes\' (number expected)') end
  204. return funcs.crypt.generatekey(size)
  205. end
  206. --[[ Basic XOR encryption because i don't know wtf synapse uses for crypt.encrypt ]]
  207. funcs.crypt.encrypt = function(a, b)
  208. local result = {}
  209. a = tostring(a) b = tostring(b)
  210. for i = 1, #a do
  211. local byte = string.byte(a, i)
  212. local keyByte = string.byte(b, (i - 1) % #b + 1)
  213. table.insert(result, string.char(bit32.bxor(byte, keyByte)))
  214. end
  215. return table.concat(result)
  216. end
  217. funcs.crypt.decrypt = funcs.crypt.encrypt
  218. funcs.crypt.random = function(len)
  219. assert(type(len)~='number', 'invalid arguement #1 to \'random\', number expected got ' .. type(len))
  220. return funcs.crypt.generatekey(len)
  221. end
  222.  
  223. local active = true
  224. game:GetService("UserInputService").WindowFocused:Connect(function()
  225. active = true
  226. end)
  227.  
  228. game:GetService("UserInputService").WindowFocusReleased:Connect(function()
  229. active = false
  230. end)
  231.  
  232. funcs.isrbxactive = function()
  233. return active
  234. end
  235. funcs.isgameactive = funcs.isrbxactive
  236. funcs.gethui = function()
  237. local s, H = pcall(function()
  238. return game:GetService("CoreGui")
  239. end)
  240. return s and H or game:GetService("Players").LocalPlayer.PlayerGui
  241. end
  242. funcs.setclipboard = function(data)
  243. local old = game:GetService("UserInputService"):GetFocusedTextBox()
  244. local copy = tostring(data)
  245. local gui = Instance.new("ScreenGui", getgenv().gethui())
  246. local a = Instance.new('TextBox', gui)
  247. a.PlaceholderText = ''
  248. a.Text = copy
  249. a.ClearTextOnFocus = false
  250. a.Size = UDim2.new(.1, 0, .15, 0)
  251. a.Position = UDim2.new(10, 0, 10, 0)
  252. a:CaptureFocus()
  253. a = Enum.KeyCode
  254. local Keys = {
  255. a.RightControl, a.A
  256. }
  257. local Keys2 = {
  258. a.RightControl, a.C, a.V
  259. }
  260. for i, v in ipairs(Keys) do
  261. vim:SendKeyEvent(true, v, false, game)
  262. task.wait()
  263. end
  264. for i, v in ipairs(Keys) do
  265. vim:SendKeyEvent(false, v, false, game)
  266. task.wait()
  267. end
  268. for i, v in ipairs(Keys2) do
  269. vim:SendKeyEvent(true, v, false, game)
  270. task.wait()
  271. end
  272. for i, v in ipairs(Keys2) do
  273. vim:SendKeyEvent(false, v, false, game)
  274. task.wait()
  275. end
  276. gui:Destroy()
  277. if old then old:CaptureFocus() end
  278. end
  279. funcs.syn.write_clipboard = funcs.setclipboard
  280. funcs.toclipboad = funcs.setclipboard
  281. funcs.setrbxclipboard = funcs.setclipboard
  282.  
  283. funcs.syn.protect_gui = function(gui) -- Does not actually protect it, just parents to gethui and renames the gui to a roblox gui.
  284. names[gui] = {name=gui.Name,parent=gui.Parent}
  285. if getgenv().gethui() == game:GetService("Players").LocalPlayer.PlayerGui then
  286. gui.Name = 'Chat'
  287. else
  288. gui.Name = 'RobloxGui'
  289. end
  290. gui.Parent = getgenv().gethui()
  291. end
  292. funcs.syn.unprotect_gui = function(gui)
  293. if names[gui] then gui.Name = names[gui].name gui.Parent = names[gui].parent end
  294. end
  295. funcs.syn.secure_call = function(func) -- Does not do a secure call, just pcalls it.
  296. return pcall(func)
  297. end
  298.  
  299.  
  300. funcs.isreadonly = function(tbl)
  301. if type(tbl) ~= 'table' then return false end
  302. return table.isfrozen(tbl)
  303. end
  304. funcs.setreadonly = function(tbl, cond)
  305. if cond then
  306. table.freeze(tbl)
  307. else
  308. return funcs.deepclone(tbl)
  309. end
  310. end
  311. funcs.httpget = function(url)
  312. return game:HttpGet(url)
  313. end
  314. funcs.httppost = function(url, body, contenttype)
  315. return game:HttpPostAsync(url, body, contenttype)
  316. end
  317. funcs.request = function(args)
  318. if args.Method == 'GET' then
  319. local result = {}
  320. local s, getresult = pcall(function() return funcs.httpget(args.Url) end)
  321. result.Body = s and getresult or ''
  322. result.Success = s
  323. result.StatusCode = s and 200 or 400 -- Inaccurate but works i guess?
  324. return result
  325. elseif args.Method == 'POST' then
  326. local result = {}
  327. local s, r = pcall(function() return funcs.httppost(args.Url, args.Body or '', args.Headers and args.Headers['Content-Type'] and args.Headers['Content-Type'] or 'application/x-www-form-urlencoded') end)
  328. result.Success = s
  329. result.Body = r
  330. result.StatusCode = s and 200 or 400 -- Inaccurate but works i guess?
  331. return result
  332. else
  333. print('script tried to send an http request with a non implemented method',args.Method)
  334. return {Success=false,StatusCode=404} -- 404 means not found which can cause some errors in scripts.
  335. end
  336. end
  337. funcs.newcclosure = function(func) -- This is a horrible attempt at making newcclosure but it is practically impossible in luau (or so i think)
  338. return function(...)
  339. func(...)
  340. end
  341. end
  342. funcs.mouse1click = function(x, y)
  343. x = x or 0
  344. y = y or 0
  345. vim:SendMouseButtonEvent(x, y, 0, true, game, false)
  346. task.wait()
  347. vim:SendMouseButtonEvent(x, y, 0, false, game, false)
  348. end
  349. funcs.mouse2click = function(x, y)
  350. x = x or 0
  351. y = y or 0
  352. vim:SendMouseButtonEvent(x, y, 1, true, game, false)
  353. task.wait()
  354. vim:SendMouseButtonEvent(x, y, 1, false, game, false)
  355. end
  356. funcs.mouse1press = function(x, y)
  357. x = x or 0
  358. y = y or 0
  359. vim:SendMouseButtonEvent(x, y, 0, true, game, false)
  360. end
  361. funcs.mouse1release = function(x, y)
  362. x = x or 0
  363. y = y or 0
  364. vim:SendMouseButtonEvent(x, y, 0, false, game, false)
  365. end
  366. funcs.mouse2press = function(x, y)
  367. x = x or 0
  368. y = y or 0
  369. vim:SendMouseButtonEvent(x, y, 1, true, game, false)
  370. end
  371. funcs.mouse2release = function(x, y)
  372. x = x or 0
  373. y = y or 0
  374. vim:SendMouseButtonEvent(x, y, 1, false, game, false)
  375. end
  376. funcs.mousescroll = function(x, y, a)
  377. x = x or 0
  378. y = y or 0
  379. a = a and true or false
  380. vim:SendMouseWheelEvent(x, y, a, game)
  381. end
  382. funcs.keyclick = function(key)
  383. if typeof(key) == 'number' then
  384. if not keys[key] then return error("Key "..tostring(key) .. ' not found!') end
  385. vim:SendKeyEvent(true, keys[key], false, game)
  386. task.wait()
  387. vim:SendKeyEvent(false, keys[key], false, game)
  388. elseif typeof(Key) == 'EnumItem' then
  389. vim:SendKeyEvent(true, key, false, game)
  390. task.wait()
  391. vim:SendKeyEvent(false, key, false, game)
  392. end
  393. end
  394. funcs.keypress = function(key)
  395. if typeof(key) == 'number' then
  396. if not keys[key] then return error("Key "..tostring(key) .. ' not found!') end
  397. vim:SendKeyEvent(true, keys[key], false, game)
  398. elseif typeof(Key) == 'EnumItem' then
  399. vim:SendKeyEvent(true, key, false, game)
  400. end
  401. end
  402. funcs.keyrelease = function(key)
  403. if typeof(key) == 'number' then
  404. if not keys[key] then return error("Key "..tostring(key) .. ' not found!') end
  405. vim:SendKeyEvent(false, keys[key], false, game)
  406. elseif typeof(Key) == 'EnumItem' then
  407. vim:SendKeyEvent(false, key, false, game)
  408. end
  409. end
  410. funcs.mousemoverel = function(relx, rely)
  411. local Pos = workspace.CurrentCamera.ViewportSize
  412. relx = relx or 0
  413. rely = rely or 0
  414. local x = Pos.X * relx
  415. local y = Pos.Y * rely
  416. vim:SendMouseMoveEvent(x, y, game)
  417. end
  418. funcs.mousemoveabs = function(x, y)
  419. x = x or 0 y = y or 0
  420. vim:SendMouseMoveEvent(x, y, game)
  421. end
  422.  
  423. funcs.isexecutorclosure = function(fnc)
  424. return Functions[fnc] and true or false
  425. end
  426.  
  427. --[[ File system is something i do not know how to implement in roblox lua.
  428. UPDATE AT 18/5/2024:
  429. I figured out i can use temp file system.
  430. ]]
  431. local files = {}
  432.  
  433. local function MakeFile(name, content)
  434. local Folders = name:split('/')
  435. local FileName = table.remove(Folders)
  436. local currentFolder = files
  437.  
  438. for _, FolderName in ipairs(Folders) do
  439. if not currentFolder[FolderName] then
  440. currentFolder[FolderName] = {}
  441. end
  442. currentFolder = currentFolder[FolderName]
  443. end
  444.  
  445. currentFolder[FileName] = content
  446. end
  447.  
  448. local function getPath(name)
  449. local Folders = name:split('/')
  450. local currentFolder = files
  451.  
  452. for _, FolderName in ipairs(Folders) do
  453. currentFolder = currentFolder[FolderName]
  454. if not currentFolder then
  455. return nil
  456. end
  457. end
  458.  
  459. return currentFolder
  460. end
  461.  
  462. funcs.writefile = function(name, content)
  463. local success, err = pcall(function()
  464. name = tostring(name)
  465. content = tostring(content)
  466. MakeFile(name, content)
  467. end)
  468. if not success then error('file error: ' .. err) end
  469. end
  470.  
  471. funcs.makefolder = function(name)
  472. local success, err = pcall(function()
  473. name = tostring(name)
  474. MakeFile(name, {})
  475. end)
  476. if not success then error('file error: ' .. err) end
  477. end
  478.  
  479. funcs.readfile = function(name)
  480. local Folders = name:split('/')
  481. local FileName = table.remove(Folders)
  482. local currentFolder = files
  483.  
  484. for _, FolderName in ipairs(Folders) do
  485. currentFolder = currentFolder[FolderName]
  486. if not currentFolder then
  487. return nil
  488. end
  489. end
  490.  
  491. return currentFolder[FileName]
  492. end
  493.  
  494. funcs.delfile = function(name)
  495. local success, err = pcall(function()
  496. local Folders = name:split('/')
  497. local FileName = table.remove(Folders)
  498. local currentFolder = files
  499.  
  500. for _, FolderName in ipairs(Folders) do
  501. currentFolder = currentFolder[FolderName]
  502. if not currentFolder then
  503. return
  504. end
  505. end
  506.  
  507. currentFolder[FileName] = nil
  508. end)
  509. if not success then error('file error: ' .. err) end
  510. end
  511.  
  512. funcs.delfolder = function(name)
  513. local success, err = pcall(function()
  514. local Folders = name:split('/')
  515. local FolderName = table.remove(Folders)
  516. local currentFolder = files
  517.  
  518. for _, FolderName in ipairs(Folders) do
  519. currentFolder = currentFolder[FolderName]
  520. if not currentFolder then
  521. return
  522. end
  523. end
  524.  
  525. currentFolder[FolderName] = nil
  526. end)
  527. if not success then error('folder error: ' .. err) end
  528. end
  529.  
  530. funcs.isfile = function(name)
  531. local path = getPath(name)
  532. return path ~= nil and type(path) ~= "table"
  533. end
  534.  
  535. funcs.isfolder = function(name)
  536. local path = getPath(name)
  537. return path ~= nil and type(path) == "table"
  538. end
  539.  
  540. funcs.listfiles = function(path)
  541. if path and path:sub(-1) == '/' then
  542. path = path:sub(1, -2)
  543. end
  544.  
  545. local updated = {}
  546. local Files = path and getPath(path) or files
  547.  
  548. if Files and type(Files) == "table" then
  549. for i, v in pairs(Files) do
  550. if v ~= nil then
  551. table.insert(updated, i)
  552. end
  553. end
  554. end
  555.  
  556. return updated
  557. end
  558.  
  559. funcs.loadfile = function(path)
  560. local fileContent = funcs.readfile(path)
  561. if fileContent then
  562. return loadstring(fileContent)
  563. else
  564. return error('file not found: ' .. path)
  565. end
  566. end
  567.  
  568. funcs.appendfile = function(name, extra)
  569. local content = funcs.readfile(name)
  570. if content then
  571. MakeFile(name, content .. tostring(extra))
  572. else
  573. error('file not found: ' .. name)
  574. end
  575. end
  576.  
  577.  
  578. funcs.http.request = funcs.request
  579. funcs.syn.crypt = funcs.crypt
  580. funcs.syn.crypto = funcs.crypt
  581. funcs.syn_backup = funcs.syn
  582.  
  583.  
  584. funcs.getexecutorname = function()
  585. return 'MoreUNC', 1
  586. end
  587. funcs.identifyexecutor = funcs.getexecutorname
  588. funcs.http_request = getgenv().request or funcs.request
  589. funcs.getscripts = function()
  590. local a = {};for i, v in pairs(game:GetDescendants()) do if v:IsA("LocalScript") or v:IsA("ModuleScript") then table.insert(a, v) end end return a
  591. end
  592. funcs.get_scripts = function()
  593. local a = {};for i, v in pairs(game:GetDescendants()) do if v:IsA("LocalScript") or v:IsA("ModuleScript") then table.insert(a, v) end end return a
  594. end
  595. funcs.getmodules = function()
  596. local a = {};for i, v in pairs(game:GetDescendants()) do if v:IsA("ModuleScript") then table.insert(a, v) end end return a
  597. end
  598. funcs.make_readonly = funcs.setreadonly
  599. funcs.makereadonly = funcs.setreadonly
  600. funcs.base64encode = funcs.crypt.base64encode
  601. funcs.base64decode = funcs.crypt.base64decode
  602. funcs.clonefunc = funcs.clonefunction
  603. funcs.getinstances = function()
  604. return game:GetDescendants()
  605. end
  606. funcs.iswriteable = function(tbl)
  607. return not table.isfrozen(tbl)
  608. end
  609. funcs.makewriteable = function(tbl)
  610. return funcs.setreadonly(tbl, false)
  611. end
  612. funcs.isscriptable = function(self, prop)
  613. local s = pcall(function()
  614. self[prop] = self[prop]
  615. end)
  616. return s
  617. end
  618. -- [[ Hashing is quiet hard (for me) so i made many functions. Please ignore, No this isnt obfuscated you can get the regular code at https://goonlinetools.com/lua-beautifier/ ]]
  619.  
  620. local function str2hexa(a)return string.gsub(a,".",function(b)return string.format("%02x",string.byte(b))end)end;local function num2s(c,d)local a=""for e=1,d do local f=c%256;a=string.char(f)..a;c=(c-f)/256 end;return a end;local function s232num(a,e)local d=0;for g=e,e+3 do d=d*256+string.byte(a,g)end;return d end;local function preproc(h,i)local j=64-(i+9)%64;i=num2s(8*i,8)h=h.."\128"..string.rep("\0",j)..i;assert(#h%64==0)return h end;local function k(h,e,l)local m={}local n={0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0x0fc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x06ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2}for g=1,16 do m[g]=s232num(h,e+(g-1)*4)end;for g=17,64 do local o=m[g-15]local p=bit.bxor(bit.rrotate(o,7),bit.rrotate(o,18),bit.rshift(o,3))o=m[g-2]local q=bit.bxor(bit.rrotate(o,17),bit.rrotate(o,19),bit.rshift(o,10))m[g]=(m[g-16]+p+m[g-7]+q)%2^32 end;local r,s,b,t,u,v,w,x=l[1],l[2],l[3],l[4],l[5],l[6],l[7],l[8]for e=1,64 do local p=bit.bxor(bit.rrotate(r,2),bit.rrotate(r,13),bit.rrotate(r,22))local y=bit.bxor(bit.band(r,s),bit.band(r,b),bit.band(s,b))local z=(p+y)%2^32;local q=bit.bxor(bit.rrotate(u,6),bit.rrotate(u,11),bit.rrotate(u,25))local A=bit.bxor(bit.band(u,v),bit.band(bit.bnot(u),w))local B=(x+q+A+n[e]+m[e])%2^32;x=w;w=v;v=u;u=(t+B)%2^32;t=b;b=s;s=r;r=(B+z)%2^32 end;l[1]=(l[1]+r)%2^32;l[2]=(l[2]+s)%2^32;l[3]=(l[3]+b)%2^32;l[4]=(l[4]+t)%2^32;l[5]=(l[5]+u)%2^32;l[6]=(l[6]+v)%2^32;l[7]=(l[7]+w)%2^32;l[8]=(l[8]+x)%2^32 end;funcs.crypt.hash=function(h)h=preproc(h,#h)local l={0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19}for e=1,#h,64 do k(h,e,l)end;return str2hexa(num2s(l[1],4)..num2s(l[2],4)..num2s(l[3],4)..num2s(l[4],4)..num2s(l[5],4)..num2s(l[6],4)..num2s(l[7],4)..num2s(l[8],4))end
  621.  
  622. funcs.Drawing.new = function(Type) -- Drawing.new
  623. local baseProps = {
  624. Visible = false,
  625. Color = Color3.new(0,0,0),
  626. }
  627. if Type == 'Line' then
  628. local a = Instance.new("Frame", Instance.new("ScreenGui", DrawingDict))
  629. a.Visible = false
  630. a.Size = UDim2.new(0, 0, 0, 0)
  631. a.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  632. a.BackgroundTransparency = 1
  633. a.BorderSizePixel = 0
  634.  
  635. local meta = baseProps
  636. meta.__index = {
  637. Thickness = 1,
  638. From = Vector2.new(0, 0),
  639. To = Vector2.new(0, 0),
  640. Transparency = 0,
  641. Remove = function(a)
  642. a:Destroy()
  643. end,
  644. Destroy = function()
  645. a:Destroy()
  646. end,
  647. updateLine = function(self)
  648. local from = self.From
  649. local to = self.To
  650. local distance = (to - from).Magnitude
  651. local angle = math.deg(math.atan2(to.Y - from.Y, to.X - from.X))
  652.  
  653. a.Size = UDim2.new(0, distance, 0, self.Thickness)
  654. a.Position = UDim2.new(0, from.X, 0, from.Y)
  655. a.Rotation = angle
  656. end
  657. }
  658.  
  659. meta.__newindex = function(self, key, value)
  660. if key == 'Thickness' and typeof(value) == 'number' then
  661. rawset(self, key, value)
  662. a.Size = UDim2.new(0, (self.To - self.From).Magnitude, 0, value)
  663. elseif key == 'Visible' and typeof(value) == 'boolean' then
  664. rawset(self, key, value)
  665. a.Visible = value
  666. elseif key == 'Color' and typeof(value) == 'Color3' then
  667. rawset(self, key, value)
  668. a.BackgroundColor3 = value
  669. elseif key == 'Transparency' and typeof(value) == 'number' and value <= 1 then
  670. rawset(self, key, value)
  671. a.BackgroundTransparency = 1 - value
  672. elseif key == 'From' and typeof(value) == 'Vector2' then
  673. rawset(self, key, value)
  674. self:updateLine()
  675. elseif key == 'To' and typeof(value) == 'Vector2' then
  676. rawset(self, key, value)
  677. self:updateLine()
  678. end
  679. end
  680.  
  681. return setmetatable({}, meta)
  682. elseif Type == 'Square' then
  683. local a = Instance.new("Frame", DrawingDict)
  684. a.Visible = false
  685. a.Size = UDim2.new(0, 0, 0, 0)
  686. a.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  687. a.BackgroundTransparency = 1
  688. a.BorderSizePixel = 0
  689. local b = Instance.new("UIStroke", a)
  690. b.Color = Color3.fromRGB(255, 255, 255)
  691. b.Enabled = true
  692.  
  693. local meta = baseProps
  694. meta.__index = {
  695. Size = Vector2.new(0,0),
  696. Position = Vector2.new(0, 0),
  697. Remove = function()
  698. a:Destroy()
  699. end,
  700. Destroy = function()
  701. a:Destroy()
  702. end,
  703. updateSquare = function(self)
  704. a.Size = UDim2.new(0, self.Size.X, 0, self.Size.Y)
  705. a.Position = UDim2.new(0, self.Position.X, 0, self.Position.Y)
  706. end
  707. }
  708.  
  709. meta.__newindex = function(self, key, value)
  710. if key == 'Filled' and typeof(value) == 'boolean' then
  711. rawset(self, key, value)
  712. b.Enabled = not value
  713. a.BackgroundTransparency = value and 0 or 1
  714. elseif key == 'Visible' and typeof(value) == 'boolean' then
  715. rawset(self, key, value)
  716. a.Visible = value
  717. elseif key == 'Color' and typeof(value) == 'Color3' then
  718. rawset(self, key, value)
  719. a.BackgroundColor3 = value
  720. b.Color = value
  721. elseif key == 'Position' and typeof(value) == 'Vector2' then
  722. rawset(self, key, value)
  723. self:updateSquare()
  724. elseif key == 'Size' and typeof(value) == 'Vector2' then
  725. rawset(self, key, value)
  726. self:updateSquare()
  727. end
  728. end
  729.  
  730. return setmetatable({}, meta)
  731. elseif Type == 'Circle' then
  732. local a = Instance.new("Frame", Instance.new("ScreenGui", DrawingDict))
  733. a.Visible = false
  734. a.Size = UDim2.new(0, 0, 0, 0)
  735. a.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  736. a.BackgroundTransparency = 1
  737. a.BorderSizePixel = 0
  738. local b = Instance.new("UIStroke", a)
  739. b.Color = Color3.fromRGB(255, 255, 255)
  740. b.Enabled = false
  741. b.Thickness = 1
  742. local c = Instance.new("UICorner", a)
  743. c.CornerRadius = UDim.new(1, 0)
  744.  
  745. local meta = baseProps
  746. meta.__index = {
  747. Thickness = 1,
  748. Filled = false,
  749. NumSides = 0,
  750. Radius = 1,
  751. Position = Vector2.new(0, 0),
  752. Transparency = 0,
  753. Remove = function()
  754. a:Destroy()
  755. end,
  756. Destroy = function()
  757. a:Destroy()
  758. end,
  759. updateCircle = function(self)
  760. a.Size = UDim2.new(0, self.Radius, 0, self.Radius)
  761. a.Position = UDim2.new(0, self.Position.X, 0, self.Position.Y)
  762. b.Enabled = not self
  763. b.Color = self.Color
  764. end
  765. }
  766.  
  767. meta.__newindex = function(self, key, value)
  768. if key == 'Thickness' and typeof(value) == 'number' then
  769. rawset(self, key, value)
  770. b.Thickness = value
  771. elseif key == 'Visible' and typeof(value) == 'boolean' then
  772. rawset(self, key, value)
  773. a.Visible = value
  774. elseif key == 'Color' and typeof(value) == 'Color3' then
  775. rawset(self, key, value)
  776. a.BackgroundColor3 = value
  777. a.Color = value
  778. elseif key == 'Transparency' and typeof(value) == 'number' then
  779. rawset(self, key, value)
  780. a.BackgroundTransparency = 1 - value
  781. elseif key == 'Position' and typeof(value) == 'Vector2' then
  782. rawset(self, key, value)
  783. self:updateCircle()
  784. elseif key == 'Radius' and typeof(value) == 'number' then
  785. rawset(self, key, value)
  786. self:updateCircle()
  787. elseif key == 'NumSides' and typeof(value) == 'number' then
  788. rawset(self, key, value)
  789. elseif key == 'Filled' and typeof(value) == 'boolean' then
  790. rawset(self, key, value)
  791. self:updateCircle()
  792. end
  793. end
  794.  
  795. return setmetatable({}, meta)
  796. elseif Type == 'Text' then
  797. local a = Instance.new("TextLabel", DrawingDict)
  798. a.Visible = false
  799. a.Size = UDim2.new(0, 0, 0, 0)
  800. a.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  801. a.BackgroundTransparency = 1
  802. a.BorderSizePixel = 0
  803. a.TextStrokeColor3 = Color3.new(0,0,0)
  804. a.TextStrokeTransparency = 1
  805.  
  806. local meta = baseProps
  807. meta.__index = {
  808. Text = '',
  809. Transparency = 0,
  810. Size = 0,
  811. Center = false,
  812. Outline = false,
  813. OutlineColor = Color3.new(0,0,0),
  814. Position = Vector2.new(0,0),
  815. Font = 3,
  816. Remove = function()
  817. a:Destroy()
  818. end,
  819. Destroy = function()
  820. a:Destroy()
  821. end,
  822. updateText = function(self)
  823. a.TextScaled = true
  824. a.Size = UDim2.new(0, self.Size * 3, 0, self.Size / 2)
  825. a.Position = UDim2.new(0, self.Position.X, 0, self.Position.Y)
  826. a.Text = self.Text
  827. a.Font = Fonts[self.Font]
  828. a.Visible = self.Visible
  829. a.TextColor3 = self.Color
  830. a.TextTrasparency = 1 - self.Transparency
  831. a.BorderSizePixel = self.Outline and 1 or 0
  832. if self.Center then
  833. a.TextXAlignment = Enum.TextXAlignment.Center
  834. a.TextYAlignment = Enum.TextYAlignment.Center
  835. else
  836. a.TextXAlignment = Enum.TextXAlignment.Left
  837. a.TextYAlignment = Enum.TextYAlignment.Top
  838. end
  839. a.TextStrokeTransparency = self.Outline and 0 or 1
  840. a.TextStrokeColor3 = self.OutlineColor
  841. end
  842. }
  843.  
  844. meta.__newindex = function(self, key, value)
  845. if key == 'Text' and typeof(value) == 'string' then
  846. rawset(self, key, value)
  847. elseif key == 'Visible' and typeof(value) == 'boolean' then
  848. rawset(self, key, value)
  849. a.Visible = value
  850. elseif key == 'Color' and typeof(value) == 'Color3' then
  851. rawset(self, key, value)
  852. elseif key == 'Transparency' and typeof(value) == 'number' then
  853. rawset(self, key, value)
  854. elseif key == 'Position' and typeof(value) == 'Vector2' then
  855. rawset(self, key, value)
  856. elseif key == 'Size' and typeof(value) == 'number' then
  857. rawset(self, key, value)
  858. elseif key == 'Outline' and typeof(value) == 'boolean' then
  859. rawset(self, key, value)
  860. elseif key == 'Center' and typeof(value) == 'boolean' then
  861. rawset(self, key, value)
  862. elseif key == 'OutlineColor' and typeof(value) == 'Color3' then
  863. rawset(self, key, value)
  864. elseif key == 'Font' and typeof(value) == 'number' then
  865. rawset(self, key, value)
  866. end
  867. self:updateText()
  868. end
  869.  
  870. return setmetatable({}, meta)
  871. end
  872. end
  873.  
  874. local Count = 0
  875. local Total = 0
  876. for index, _ in pairs(Descendants(funcs)) do
  877. if not getgenv()[index] then
  878. Total = Total + 1
  879. end
  880. end
  881. for i, v in pairs(Descendants(funcs)) do
  882. if not getgenv()[i] then Count = Count + 1 end
  883. local Result = SafeOverride(i, v)
  884. local str = Result == 1 and ('%s %s already exists.'):format(type(v), i) or Result == 2 and ("Added %s %s to the global environment. (%d/%d)"):format(type(v), i, Count, Total) or Result ~= 1 and Result ~= 2 and ("Unknown result for function %s."):format(type(v), i)
  885. print(str)
  886. end
  887. funcs.syn.protect_gui(DrawingDict)
Add Comment
Please, Sign In to add comment