DARKMODZ

lol

May 11th, 2024 (edited)
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 55.50 KB | None | 0 0
  1. local exploit_name = "Dark"
  2. local identity = 4
  3.  
  4. function printidentity()
  5. if (identity == 0) then identity = 4 else identity = identity end
  6. print("Current identity is "..identity)
  7. end
  8.  
  9. function setidentity(id)
  10. if (id > 4) then
  11. error("Cannot set to a higher identity")
  12. else
  13. identity = id
  14. end
  15. end
  16.  
  17. function getidentity()
  18. return identity
  19. end
  20.  
  21.  
  22. function getexecutorname()
  23. if (exploit_name == "") then
  24. exploit_name = "Dark"
  25. else
  26. return exploit_name
  27. end
  28.  
  29. function identifyexecutor()
  30. return exploit_name
  31. end
  32.  
  33. function GetObjects(obj)
  34. game:GetService("InsertService"):LoadLocalAsset(obj)
  35. end
  36.  
  37. function rconsoleclear()
  38. print(("\n"):rep(20))
  39. end
  40.  
  41. function consoleclear()
  42. print(("\n"):rep(20))
  43. end
  44.  
  45. function getscriptbytecode(str)
  46. local byteArray = {}
  47. for i = 1, #str do
  48. local c = string.sub(str, i, i)
  49. table.insert(byteArray, string.byte(c))
  50. end
  51.  
  52. return byteArray
  53. end
  54.  
  55. function isrbxactive()
  56. UIS = game:GetService("UserInputService")
  57.  
  58. UIS.WindowFocused:Connect(function()
  59. return true
  60. end)
  61.  
  62. UIS.WindowFocusReleased:Connect(function()
  63. return false
  64. end)
  65. end
  66.  
  67. -- LMFAO imagine lol
  68. function saveinstance()
  69. error("saveinstance could not save this game")
  70. end
  71.  
  72. function gethui()
  73. return game.CoreGui or game.Players.LocalPlayer.PlayerGui
  74. end
  75.  
  76.  
  77. function isluau()
  78. return _VERSION == "Luau"
  79. end
  80.  
  81. function loadstring(scrpt)
  82. execscript = Instance.new("LocalScript")
  83. execscript.Parent = script
  84. execscript.Source = scrpt
  85. return execscript
  86. end
  87.  
  88. -- hacky shit i dont know who the fu wants this like this
  89. -- no c++ so it stays 60 lmfao
  90.  
  91. function setfpscap(thefps)
  92. RunService = game:GetService("RunService")
  93. TARGET_FRAME_RATE = math.min(thefps, 60)
  94.  
  95. local function onPreSimulation()
  96. startTime = os.clock()
  97. while os.clock() - startTime < 1 / TARGET_FRAME_RATE do
  98. -- nothin
  99. end
  100. end
  101.  
  102. RunService.PreSimulation:DisconnectAll()
  103. RunService.PreSimulation:Connect(onPreSimulation)
  104.  
  105. return thefps
  106. end
  107.  
  108.  
  109. function getinstances()
  110. local instances = {}
  111.  
  112. local function allinstance(parent)
  113. for _, child in ipairs(parent:GetChildren()) do
  114. table.insert(instances, child)
  115. allinstance(child)
  116. end
  117. end
  118.  
  119. allinstance(game)
  120.  
  121. return instances
  122. end
  123.  
  124. function getscripts()
  125. local scripts = {}
  126.  
  127. local function allscripts(parent)
  128. for _, child in ipairs(parent:GetChildren()) do
  129. if child:IsA("LocalScript") or child:IsA("Script") or child:IsA("ModuleScript") then
  130. table.insert(scripts, child)
  131. end
  132. allscripts(child)
  133. end
  134. end
  135.  
  136. allscripts(game)
  137.  
  138. return scripts
  139. end
  140.  
  141. function getnilinstances()
  142. local nilInstances = {}
  143.  
  144. local function updateNilInstances(descendant)
  145. if descendant.Parent == nil then
  146. table.insert(nilInstances, descendant)
  147. else
  148. for i, v in ipairs(nilInstances) do
  149. if v == descendant then
  150. table.remove(nilInstances, i)
  151. break
  152. end
  153. end
  154. end
  155. end
  156.  
  157. game.DescendantRemoving:Connect(function(descendant)
  158. updateNilInstances(descendant)
  159. end)
  160.  
  161. game.DescendantAdded:Connect(function(descendant)
  162. updateNilInstances(descendant)
  163. end)
  164.  
  165. return nilInstances
  166. end
  167.  
  168.  
  169.  
  170. local is_executor_closure = is_syn_closure or is_fluxus_closure or is_sentinel_closure or is_krnl_closure or is_proto_closure or is_calamari_closure or is_electron_closure or is_elysian_closure
  171.  
  172. local dbg = {}
  173. function getcallingscript()
  174. local s = debug.info(1, 's')
  175. for i, v in next, game:GetDescendants() do
  176. if v:GetFullName() == s then return v end
  177. end
  178. return nil
  179. end
  180. function dbg.getinfo(thread)
  181. local CurrentLine = tonumber(debug.info(thread, 'l'))
  182. local Source = debug.info(thread, 's')
  183. local name = debug.info(thread, 'n')
  184. local numparams, isvrg = debug.info(thread, 'a')
  185. if #name == 0 then name = nil end
  186. local a, b = debug.info(thread, 'a')
  187. return {
  188. ['currentline'] = CurrentLine,
  189. ['Source'] = Source,
  190. ['name'] = tostring(name),
  191. ['numparams'] = tonumber(numparams),
  192. ['is_vararg'] = isvrg and 1 or 0,
  193. ['short_src'] = tostring(Source:sub(1, 60))
  194. }
  195. end
  196. return dbg
  197.  
  198. -----------------------------
  199.  
  200. wait()
  201.  
  202. -- Gui to Lua
  203. -- Version: 3.6
  204.  
  205. -- Instances:
  206.  
  207. local syntax = Instance.new("ScreenGui")
  208. local Frame = Instance.new("Frame")
  209. local TextLabel = Instance.new("TextLabel")
  210. local TextButton = Instance.new("TextButton")
  211. local TextButton_2 = Instance.new("TextButton")
  212. local EditorFrame = Instance.new("ScrollingFrame")
  213. local Source = Instance.new("TextBox")
  214. local Globals_ = Instance.new("TextLabel")
  215. local Keywords_ = Instance.new("TextLabel")
  216. local RemoteHighlight_ = Instance.new("TextLabel")
  217. local Strings_ = Instance.new("TextLabel")
  218. local Tokens_ = Instance.new("TextLabel")
  219. local Numbers_ = Instance.new("TextLabel")
  220. local Strings2_ = Instance.new("TextLabel")
  221. local Strings3_ = Instance.new("TextLabel")
  222. local Comments_ = Instance.new("TextLabel")
  223. local Comments2_ = Instance.new("TextLabel")
  224. local Lines = Instance.new("TextLabel")
  225.  
  226. -- Properties:
  227.  
  228. syntax.Name = "syntax"
  229.  
  230. local success, err = pcall(function()
  231. syntax.Parent = game.CoreGui
  232. print("coregui access")
  233. end)
  234.  
  235. if not success then
  236. syntax.Parent = game.Players.LocalPlayer.PlayerGui
  237. print("coregui error gethui() will equal playergui not coregui.")
  238. end
  239.  
  240.  
  241. Frame.Parent = syntax
  242. Frame.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  243. Frame.BorderColor3 = Color3.fromRGB(0, 0, 0)
  244. Frame.BorderSizePixel = 0
  245. Frame.Position = UDim2.new(0, 45, 0, 147)
  246. Frame.Size = UDim2.new(0, 613, 0, 292)
  247.  
  248. TextLabel.Parent = Frame
  249. TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  250. TextLabel.BackgroundTransparency = 1.000
  251. TextLabel.BorderColor3 = Color3.fromRGB(0, 0, 0)
  252. TextLabel.BorderSizePixel = 0
  253. TextLabel.Position = UDim2.new(-0.0151515156, 0, 0, 0)
  254. TextLabel.Size = UDim2.new(0, 103, 0, 34)
  255. TextLabel.Font = Enum.Font.AmaticSC
  256. TextLabel.Text = "DARK"
  257. TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  258. TextLabel.TextScaled = true
  259. TextLabel.TextSize = 14.000
  260. TextLabel.TextWrapped = true
  261.  
  262. TextButton.Parent = Frame
  263. TextButton.BackgroundColor3 = Color3.fromRGB(70, 70, 70)
  264. TextButton.BorderColor3 = Color3.fromRGB(0, 0, 0)
  265. TextButton.Position = UDim2.new(0, 0, 0, 292)
  266. TextButton.Size = UDim2.new(0, 306, 0, 48)
  267. TextButton.Font = Enum.Font.SourceSans
  268. TextButton.Text = "Execute"
  269. TextButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  270. TextButton.TextScaled = true
  271. TextButton.TextSize = 14.000
  272. TextButton.TextWrapped = true
  273.  
  274. TextButton_2.Parent = Frame
  275. TextButton_2.BackgroundColor3 = Color3.fromRGB(70, 70, 70)
  276. TextButton_2.BorderColor3 = Color3.fromRGB(0, 0, 0)
  277. TextButton_2.Position = UDim2.new(0, 306, 0, 292)
  278. TextButton_2.Size = UDim2.new(0, 306, 0, 48)
  279. TextButton_2.Font = Enum.Font.SourceSans
  280. TextButton_2.Text = "Clear"
  281. TextButton_2.TextColor3 = Color3.fromRGB(255, 255, 255)
  282. TextButton_2.TextScaled = true
  283. TextButton_2.TextSize = 14.000
  284. TextButton_2.TextWrapped = true
  285.  
  286. EditorFrame.Name = "EditorFrame"
  287. EditorFrame.Parent = Frame
  288. EditorFrame.BackgroundColor3 = Color3.fromRGB(37, 37, 37)
  289. EditorFrame.BorderColor3 = Color3.fromRGB(61, 61, 61)
  290. EditorFrame.BorderSizePixel = 0
  291. EditorFrame.Position = UDim2.new(0, 0, 0, 34)
  292. EditorFrame.Size = UDim2.new(0, 613, 0, 257)
  293. EditorFrame.ZIndex = 3
  294. EditorFrame.BottomImage = "rbxassetid://148970562"
  295. EditorFrame.CanvasSize = UDim2.new(0, 0, 0, 0)
  296. EditorFrame.BottomImage = "rbxassetid://148970562"
  297. EditorFrame.HorizontalScrollBarInset = Enum.ScrollBarInset.ScrollBar
  298. EditorFrame.MidImage = "rbxassetid://148970562"
  299. EditorFrame.TopImage = "rbxassetid://148970562"
  300. EditorFrame.ScrollBarThickness = 5
  301. EditorFrame.TopImage = "rbxassetid://148970562"
  302.  
  303. Source.Name = "Source"
  304. Source.Parent = EditorFrame
  305. Source.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  306. Source.BackgroundTransparency = 1.000
  307. Source.Position = UDim2.new(0, 30, 0, 0)
  308. Source.Size = UDim2.new(0.950160801, 0, 1, 0)
  309. Source.ZIndex = 3
  310. Source.ClearTextOnFocus = false
  311. Source.Font = Enum.Font.Code
  312. Source.MultiLine = true
  313. Source.PlaceholderColor3 = Color3.fromRGB(204, 204, 204)
  314. Source.Text = ""
  315. Source.TextColor3 = Color3.fromRGB(204, 204, 204)
  316. Source.TextSize = 15.000
  317. Source.TextXAlignment = Enum.TextXAlignment.Left
  318. Source.TextYAlignment = Enum.TextYAlignment.Top
  319.  
  320. Globals_.Name = "Globals_"
  321. Globals_.Parent = Source
  322. Globals_.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  323. Globals_.BackgroundTransparency = 1.000
  324. Globals_.Size = UDim2.new(1, 0, 1, 0)
  325. Globals_.ZIndex = 5
  326. Globals_.Font = Enum.Font.Code
  327. Globals_.Text = ""
  328. Globals_.TextColor3 = Color3.fromRGB(132, 214, 247)
  329. Globals_.TextSize = 15.000
  330. Globals_.TextXAlignment = Enum.TextXAlignment.Left
  331. Globals_.TextYAlignment = Enum.TextYAlignment.Top
  332.  
  333. Keywords_.Name = "Keywords_"
  334. Keywords_.Parent = Source
  335. Keywords_.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  336. Keywords_.BackgroundTransparency = 1.000
  337. Keywords_.Size = UDim2.new(1, 0, 1, 0)
  338. Keywords_.ZIndex = 5
  339. Keywords_.Font = Enum.Font.Code
  340. Keywords_.Text = ""
  341. Keywords_.TextColor3 = Color3.fromRGB(248, 109, 124)
  342. Keywords_.TextSize = 15.000
  343. Keywords_.TextXAlignment = Enum.TextXAlignment.Left
  344. Keywords_.TextYAlignment = Enum.TextYAlignment.Top
  345.  
  346. RemoteHighlight_.Name = "RemoteHighlight_"
  347. RemoteHighlight_.Parent = Source
  348. RemoteHighlight_.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  349. RemoteHighlight_.BackgroundTransparency = 1.000
  350. RemoteHighlight_.Size = UDim2.new(1, 0, 1, 0)
  351. RemoteHighlight_.ZIndex = 5
  352. RemoteHighlight_.Font = Enum.Font.Code
  353. RemoteHighlight_.Text = ""
  354. RemoteHighlight_.TextColor3 = Color3.fromRGB(0, 144, 255)
  355. RemoteHighlight_.TextSize = 15.000
  356. RemoteHighlight_.TextXAlignment = Enum.TextXAlignment.Left
  357. RemoteHighlight_.TextYAlignment = Enum.TextYAlignment.Top
  358.  
  359. Strings_.Name = "Strings_"
  360. Strings_.Parent = Source
  361. Strings_.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  362. Strings_.BackgroundTransparency = 1.000
  363. Strings_.Size = UDim2.new(1, 0, 1, 0)
  364. Strings_.ZIndex = 5
  365. Strings_.Font = Enum.Font.Code
  366. Strings_.Text = ""
  367. Strings_.TextColor3 = Color3.fromRGB(173, 241, 149)
  368. Strings_.TextSize = 15.000
  369. Strings_.TextXAlignment = Enum.TextXAlignment.Left
  370. Strings_.TextYAlignment = Enum.TextYAlignment.Top
  371.  
  372. Tokens_.Name = "Tokens_"
  373. Tokens_.Parent = Source
  374. Tokens_.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  375. Tokens_.BackgroundTransparency = 1.000
  376. Tokens_.Size = UDim2.new(1, 0, 1, 0)
  377. Tokens_.ZIndex = 5
  378. Tokens_.Font = Enum.Font.Code
  379. Tokens_.Text = ""
  380. Tokens_.TextColor3 = Color3.fromRGB(255, 255, 255)
  381. Tokens_.TextSize = 15.000
  382. Tokens_.TextXAlignment = Enum.TextXAlignment.Left
  383. Tokens_.TextYAlignment = Enum.TextYAlignment.Top
  384.  
  385. Numbers_.Name = "Numbers_"
  386. Numbers_.Parent = Source
  387. Numbers_.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  388. Numbers_.BackgroundTransparency = 1.000
  389. Numbers_.Size = UDim2.new(1, 0, 1, 0)
  390. Numbers_.ZIndex = 4
  391. Numbers_.Font = Enum.Font.Code
  392. Numbers_.Text = ""
  393. Numbers_.TextColor3 = Color3.fromRGB(255, 198, 0)
  394. Numbers_.TextSize = 15.000
  395. Numbers_.TextXAlignment = Enum.TextXAlignment.Left
  396. Numbers_.TextYAlignment = Enum.TextYAlignment.Top
  397.  
  398. Strings2_.Name = "Strings2_"
  399. Strings2_.Parent = Source
  400. Strings2_.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  401. Strings2_.BackgroundTransparency = 1.000
  402. Strings2_.Size = UDim2.new(1, 0, 1, 0)
  403. Strings2_.ZIndex = 5
  404. Strings2_.Font = Enum.Font.Code
  405. Strings2_.Text = ""
  406. Strings2_.TextColor3 = Color3.fromRGB(173, 241, 149)
  407. Strings2_.TextSize = 15.000
  408. Strings2_.TextXAlignment = Enum.TextXAlignment.Left
  409. Strings2_.TextYAlignment = Enum.TextYAlignment.Top
  410.  
  411. Strings3_.Name = "Strings3_"
  412. Strings3_.Parent = Source
  413. Strings3_.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  414. Strings3_.BackgroundTransparency = 1.000
  415. Strings3_.Size = UDim2.new(1, 0, 1, 0)
  416. Strings3_.ZIndex = 5
  417. Strings3_.Font = Enum.Font.Code
  418. Strings3_.Text = ""
  419. Strings3_.TextColor3 = Color3.fromRGB(173, 241, 149)
  420. Strings3_.TextSize = 15.000
  421. Strings3_.TextXAlignment = Enum.TextXAlignment.Left
  422. Strings3_.TextYAlignment = Enum.TextYAlignment.Top
  423.  
  424. Comments_.Name = "Comments_"
  425. Comments_.Parent = Source
  426. Comments_.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  427. Comments_.BackgroundTransparency = 1.000
  428. Comments_.Position = UDim2.new(-0.00800000038, 0, 0, 0)
  429. Comments_.Size = UDim2.new(1, 0, 1, 0)
  430. Comments_.ZIndex = 5
  431. Comments_.Font = Enum.Font.Code
  432. Comments_.Text = ""
  433. Comments_.TextColor3 = Color3.fromRGB(59, 200, 59)
  434. Comments_.TextSize = 15.000
  435. Comments_.TextXAlignment = Enum.TextXAlignment.Left
  436. Comments_.TextYAlignment = Enum.TextYAlignment.Top
  437.  
  438. Comments2_.Name = "Comments2_"
  439. Comments2_.Parent = Source
  440. Comments2_.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  441. Comments2_.BackgroundTransparency = 1.000
  442. Comments2_.Size = UDim2.new(1, 0, 1, 0)
  443. Comments2_.ZIndex = 5
  444. Comments2_.Font = Enum.Font.Code
  445. Comments2_.Text = ""
  446. Comments2_.TextColor3 = Color3.fromRGB(59, 200, 59)
  447. Comments2_.TextSize = 15.000
  448. Comments2_.TextXAlignment = Enum.TextXAlignment.Left
  449. Comments2_.TextYAlignment = Enum.TextYAlignment.Top
  450.  
  451. Lines.Name = "Lines"
  452. Lines.Parent = EditorFrame
  453. Lines.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  454. Lines.BackgroundTransparency = 1.000
  455. Lines.Size = UDim2.new(0, 30, 1, 0)
  456. Lines.ZIndex = 4
  457. Lines.Font = Enum.Font.Code
  458. Lines.Text = "0"
  459. Lines.TextColor3 = Color3.fromRGB(255, 255, 255)
  460. Lines.TextSize = 15.000
  461. Lines.TextYAlignment = Enum.TextYAlignment.Top
  462.  
  463. -- Scripts:
  464.  
  465. local function AMQSF_fake_script() -- syntax.MainScript
  466. local script = Instance.new('LocalScript', syntax)
  467.  
  468.  
  469. local L_1_ = script.Parent.EditorFrame.Source local L_2_ = Vector2.new(0, 0) local L_3_ = { "getrawmetatable", "game", "workspace", "script", "math", "string", "table", "print", "wait", "BrickColor", "Color3", "next", "pairs", "ipairs", "select", "unpack", "Instance", "Vector2", "Vector3", "CFrame", "Ray", "UDim2", "Enum", "assert", "error", "warn", "tick", "loadstring", "_G", "shared", "getfenv", "setfenv", "newproxy", "setmetatable", "getmetatable", "os", "debug", "pcall", "ypcall", "xpcall", "rawequal", "rawset", "rawget", "tonumber", "tostring", "type", "typeof", "_VERSION", "coroutine", "delay", "require", "spawn", "LoadLibrary", "settings", "stats", "time", "UserSettings", "version", "Axes", "ColorSequence", "Faces", "ColorSequenceKeypoint", "NumberRange", "NumberSequence", "NumberSequenceKeypoint", "gcinfo", "elapsedTime", "collectgarbage", "PhysicalProperties", "Rect", "Region3", "Region3int16", "UDim", "Vector2int16", "Vector3int16" } local L_4_ = { "and", "break", "do", "else", "elseif", "end", "false", "for", "function", "goto", "if", "in", "local", "nil", "not", "or", "repeat", "return", "then", "true", "until", "while" } function G_1_(L_7_arg1, L_8_arg2) local L_9_ = {} for L_13_forvar1, L_14_forvar2 in next, L_8_arg2 do L_9_[L_14_forvar2] = L_14_forvar2 end local L_10_ = { ["="] = true, ["."] = true, [","] = true, ["("] = true, [")"] = true, ["["] = true, ["]"] = true, ["{"] = true, ["}"] = true, [":"] = true, ["*"] = true, ["/"] = true, ["+"] = true, ["-"] = true, ["%"] = true, [";"] = true, ["~"] = true } local L_11_ = "" local L_12_ = string.gsub(L_7_arg1, '\46', function(L_15_arg1) if L_10_[L_15_arg1] then return "\32" else return L_15_arg1 end end) L_11_ = string.gsub(L_12_, '%S+', function(L_16_arg1) if L_9_[L_16_arg1] ~= nil then return L_9_[L_16_arg1] else return (' '):rep(#L_16_arg1) end end) return L_11_ end function G_2_(L_17_arg1) local L_18_ = false local L_19_ = "" L_17_arg1:gsub('\46', function(L_20_arg1) if L_20_arg1 == '"' and L_18_ == false then L_18_ = true L_19_ = L_19_..'"' elseif L_18_ == true and L_20_arg1 == '"' then L_18_ = false L_19_ = L_19_..'"' end if L_18_ == true and L_20_arg1 ~= '"' then L_19_ = L_19_..L_20_arg1 end if L_18_ == false and L_20_arg1 == '"' then elseif L_20_arg1 == "\n" and L_18_ == false then L_19_ = L_19_.."\n" elseif L_20_arg1 == "\t" and L_18_ == false then L_19_ = L_19_.."\t" elseif L_18_ == false then L_19_ = L_19_.." " end end) return L_19_ end function G_3_(L_21_arg1) local L_22_ = false local L_23_ = "" L_21_arg1:gsub('\46', function(L_24_arg1) if L_24_arg1 == "'" and L_22_ == false then L_22_ = true L_23_ = L_23_.."'" elseif L_22_ == true and L_24_arg1 == "'" then L_22_ = false L_23_ = L_23_.."'" end if L_22_ == true and L_24_arg1 ~= "'" then L_23_ = L_23_..L_24_arg1 end if L_22_ == false and L_24_arg1 == "'" then elseif L_24_arg1 == "\n" and L_22_ == false then L_23_ = L_23_.."\n" elseif L_24_arg1 == "\t" and L_22_ == false then L_23_ = L_23_.."\t" elseif L_22_ == false then L_23_ = L_23_.." " end end) return L_23_ end function G_4_(L_25_arg1) local L_26_ = false local L_27_ = "" local L_28_ = 0 L_25_arg1:gsub('\46', function(L_29_arg1) if L_25_arg1:sub(L_28_, L_28_ + 1) == '[[' and L_26_ == false then L_26_ = true L_27_ = L_27_.."[" elseif L_26_ == true and L_25_arg1:sub(L_28_, L_28_ + 1) == ']]' then L_26_ = false L_27_ = L_27_.."]" end if L_26_ == true and L_25_arg1:sub(L_28_, L_28_ + 1) ~= ']]' then L_27_ = L_27_..L_29_arg1 end if L_29_arg1 == "\n" and L_26_ == false then L_27_ = L_27_.."\n" end if L_29_arg1 == "\t" and L_26_ == false then L_27_ = L_27_.."\t" end if L_26_ == false then L_27_ = L_27_.." " end L_28_ = L_28_ + 1 end) return L_27_ end function G_5_(L_30_arg1) local L_31_ = false local L_32_ = "" local L_33_ = 0 L_30_arg1:gsub('\46', function(L_34_arg1) if L_30_arg1:sub(L_33_, L_33_ + 1) == '--' and L_31_ == false then L_31_ = true L_32_ = L_32_..'-' elseif L_31_ == true and L_34_arg1 == '\n' then L_31_ = false end if L_31_ == true then L_32_ = L_32_..L_34_arg1 end if L_31_ == false and L_30_arg1:sub(L_33_, L_33_ + 1) == '--' then elseif L_34_arg1 == "\n" and L_31_ == false then L_32_ = L_32_.."\n" elseif L_34_arg1 == "\t" and L_31_ == false then L_32_ = L_32_.."\t" elseif L_31_ == false then L_32_ = L_32_.." " end L_33_ = L_33_ + 1 end) return L_32_:sub(2) end function G_6_(L_35_arg1) local L_36_ = { ["="] = true, ["."] = true, [","] = true, ["("] = true, [")"] = true, ["["] = true, ["]"] = true, ["{"] = true, ["}"] = true, [":"] = true, ["*"] = true, ["/"] = true, ["+"] = true, ["-"] = true, ["%"] = true, [";"] = true, ["~"] = true } local L_37_ = "" local L_38_ = L_35_arg1:gsub("\46", function(L_39_arg1) if L_36_[L_39_arg1] ~= nil then L_37_ = L_37_..L_39_arg1 elseif L_39_arg1 == "\n" then L_37_ = L_37_..L_39_arg1 elseif L_39_arg1 == "\t" then L_37_ = L_37_..L_39_arg1 else L_37_ = L_37_.." " end end) return L_37_ end function G_7_(L_40_arg1) if typeof(L_40_arg1) == "number" then L_40_arg1 = tostring(L_40_arg1) end local L_41_ = "" local L_42_ = L_40_arg1:gsub("\46", function(L_43_arg1) if tonumber(L_43_arg1) then L_41_ = L_41_..L_43_arg1 elseif L_43_arg1 == "\n" then L_41_ = L_41_..L_43_arg1 elseif L_43_arg1 == "\t" then L_41_ = L_41_..L_43_arg1 else L_41_ = L_41_.." " end end) return L_41_ end function G_8_(L_44_arg1) local L_45_ = false local L_46_ = "" local L_47_ = 0 L_44_arg1:gsub('\46', function(L_48_arg1) if L_44_arg1:sub(L_47_, L_47_ + 3) == '--[[' and L_45_ == false then L_45_ = true L_46_ = L_46_..'-' elseif L_45_ == true and L_44_arg1:sub(L_47_, L_47_ + 1) == ']]' then L_45_ = false L_46_ = L_46_.."]" end if L_45_ == true and L_44_arg1:sub(L_47_, L_47_ + 1) ~= "]]" then L_46_ = L_46_..L_48_arg1 end if L_45_ == false and L_44_arg1:sub(L_47_, L_47_ + 1) == '--' then elseif L_48_arg1 == "\n" and L_45_ == false then L_46_ = L_46_.."\n" elseif L_48_arg1 == "\t" and L_45_ == false then L_46_ = L_46_.."\t" elseif L_45_ == false then L_46_ = L_46_.." " end L_47_ = L_47_ + 1 end) return L_46_:sub(2) end local function L_5_func(L_49_arg1) local L_50_, L_51_ = L_49_arg1.CanvasSize.Y.Offset, L_49_arg1.AbsoluteWindowSize.Y local L_52_ = L_50_ - L_51_ if L_52_ < 0 then L_52_ = 0 end local L_53_ = Vector2.new(L_49_arg1.CanvasPosition.X, L_52_) return L_53_ end print(G_5_'s') wait(.2) local L_6_ = 20 L_1_.Changed:Connect(function() local L_54_ = L_1_.Comments_ local L_55_ = L_1_.Comments2_ local L_56_ = L_1_.Tokens_ local L_57_ = L_1_.Numbers_ local L_58_ = L_1_.Strings_ local L_59_ = L_1_.Strings2_ local L_60_ = L_1_.Strings3_ local L_61_ = L_1_.Keywords_ local L_62_ = L_1_.Globals_ L_54_.Text = " "..G_5_(L_1_.Text) L_55_.Text = ""..G_8_(L_1_.Text) L_58_.Text = G_2_(L_1_.Text) L_59_.Text = G_3_(L_1_.Text) L_60_.Text = G_4_(L_1_.Text):sub(2) L_61_.Text = G_1_(L_1_.Text, L_4_) L_62_.Text = G_1_(L_1_.Text, L_3_) L_56_.Text = G_6_(L_1_.Text) L_57_.Text = G_7_(L_1_.Text) local L_63_ = 1 L_1_.Text:gsub('\n', function() L_63_ = L_63_ + 1 end) L_1_.Parent.Lines.Text = "" for L_64_forvar1 = 1, L_63_ do L_1_.Parent.Lines.Text = L_1_.Parent.Lines.Text..L_64_forvar1.."\n" end L_1_.Parent.CanvasSize = (UDim2.new(0, L_1_.TextBounds.X + 15 + 5, 0, L_1_.TextBounds.Y)) if L_1_.Parent.CanvasPosition.Y == L_2_.Y then L_1_.Parent.CanvasPosition = L_5_func(L_1_.Parent) else L_2_ = L_5_func(L_1_.Parent) end end) L_1_.MouseWheelBackward:Connect(function(L_65_arg1, L_66_arg2) wait(.1) game.TweenService:Create(L_1_.Parent, TweenInfo.new(.1, Enum.EasingStyle.Bounce), { CanvasPosition = L_1_.Parent.CanvasPosition + Vector2.new(0, L_6_) }):Play() L_6_ = L_6_ + 5 wait(1) L_6_ = L_6_ - 5 end) L_1_.MouseWheelForward:Connect(function(L_67_arg1, L_68_arg2) wait(.1) game.TweenService:Create(L_1_.Parent, TweenInfo.new(.5, Enum.EasingStyle.Bounce), { CanvasPosition = L_1_.Parent.CanvasPosition + Vector2.new(0, -L_6_) }):Play() L_6_ = L_6_ + 5 wait(1) L_6_ = L_6_ - 5 end)
  470. end
  471. coroutine.wrap(AMQSF_fake_script)()
  472. local function RJGARLZ_fake_script() -- TextButton.LocalScript
  473. local script = Instance.new('LocalScript', TextButton)
  474.  
  475. exec = script.Parent
  476. frame = script.Parent.Parent
  477. editor = script.Parent.Parent.Parent.EditorFrame.Source
  478.  
  479. exec.MouseButton1Click:connect(function()
  480. loadstring(editor.Text)()
  481. end)
  482. end
  483. coroutine.wrap(RJGARLZ_fake_script)()
  484. local function NTGLZZV_fake_script() -- TextButton_2.LocalScript
  485. local script = Instance.new('LocalScript', TextButton_2)
  486.  
  487. exec = script.Parent
  488. frame = script.Parent.Parent
  489. editor = script.Parent.Parent.Parent.EditorFrame.Source
  490.  
  491. exec.MouseButton1Click:connect(function()
  492. editor.Text = ""
  493. end)
  494. end
  495. coroutine.wrap(NTGLZZV_fake_script)()
  496. local function OFZTV_fake_script() -- Frame.drag
  497. local script = Instance.new('LocalScript', Frame)
  498.  
  499. --Not made by me, check out this video: https://www.youtube.com/watch?v=z25nyNBG7Js&t=22s
  500. --Put this inside of your Frame and configure the speed if you would like.
  501. --Enjoy! Credits go to: https://www.youtube.com/watch?v=z25nyNBG7Js&t=22s
  502.  
  503. local UIS = game:GetService('UserInputService')
  504. local frame = script.Parent
  505. local dragToggle = nil
  506. local dragSpeed = 0.25
  507. local dragStart = nil
  508. local startPos = nil
  509.  
  510. local function updateInput(input)
  511. local delta = input.Position - dragStart
  512. local position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X,
  513. startPos.Y.Scale, startPos.Y.Offset + delta.Y)
  514. game:GetService('TweenService'):Create(frame, TweenInfo.new(dragSpeed), {Position = position}):Play()
  515. end
  516.  
  517. frame.InputBegan:Connect(function(input)
  518. if (input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch) then
  519. dragToggle = true
  520. dragStart = input.Position
  521. startPos = frame.Position
  522. input.Changed:Connect(function()
  523. if input.UserInputState == Enum.UserInputState.End then
  524. dragToggle = false
  525. end
  526. end)
  527. end
  528. end)
  529.  
  530. UIS.InputChanged:Connect(function(input)
  531. if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
  532. if dragToggle then
  533. updateInput(input)
  534. end
  535. end
  536. end)
  537.  
  538. end
  539. coroutine.wrap(OFZTV_fake_script)()
  540.  
  541.  
  542. wait()
  543.  
  544. ----------------------------------------------------------------------
  545. local passes, fails, undefined = 0, 0, 0
  546. local running = 0
  547.  
  548. local function getGlobal(path)
  549. local value = getfenv(0)
  550.  
  551. while value ~= nil and path ~= "" do
  552. local name, nextValue = string.match(path, "^([^.]+)%.?(.*)$")
  553. value = value[name]
  554. path = nextValue
  555. end
  556.  
  557. return value
  558. end
  559.  
  560. local function test(name, aliases, callback)
  561. running += 1
  562.  
  563. task.spawn(function()
  564. if not callback then
  565. print("⏺️ " .. name)
  566. elseif not getGlobal(name) then
  567. fails += 1
  568. warn("⛔ " .. name)
  569. else
  570. local success, message = pcall(callback)
  571.  
  572. if success then
  573. passes += 1
  574. print("✅ " .. name .. (message and " • " .. message or ""))
  575. else
  576. fails += 1
  577. warn("⛔ " .. name .. " failed: " .. message)
  578. end
  579. end
  580.  
  581. local undefinedAliases = {}
  582.  
  583. for _, alias in ipairs(aliases) do
  584. if getGlobal(alias) == nil then
  585. table.insert(undefinedAliases, alias)
  586. end
  587. end
  588.  
  589. if #undefinedAliases > 0 then
  590. undefined += 1
  591. warn("⚠️ " .. table.concat(undefinedAliases, ", "))
  592. end
  593.  
  594. running -= 1
  595. end)
  596. end
  597.  
  598. -- Header and summary
  599.  
  600. print("\n")
  601.  
  602. print("UNC Environment Check")
  603. print("✅ - Pass, ⛔ - Fail, ⏺️ - No test, ⚠️ - Missing aliases\n")
  604.  
  605. task.defer(function()
  606. repeat task.wait() until running == 0
  607.  
  608. local rate = math.round(passes / (passes + fails) * 100)
  609. local outOf = passes .. " out of " .. (passes + fails)
  610.  
  611. print("\n")
  612.  
  613. print("UNC Summary")
  614. print("✅ Tested with a " .. rate .. "% success rate (" .. outOf .. ")")
  615. print("⛔ " .. fails .. " tests failed")
  616. print("⚠️ " .. undefined .. " globals are missing aliases")
  617. end)
  618.  
  619. -- Cache
  620.  
  621. test("cache.invalidate", {}, function()
  622. local container = Instance.new("Folder")
  623. local part = Instance.new("Part", container)
  624. cache.invalidate(container:FindFirstChild("Part"))
  625. assert(part ~= container:FindFirstChild("Part"), "Reference `part` could not be invalidated")
  626. end)
  627.  
  628. test("cache.iscached", {}, function()
  629. local part = Instance.new("Part")
  630. assert(cache.iscached(part), "Part should be cached")
  631. cache.invalidate(part)
  632. assert(not cache.iscached(part), "Part should not be cached")
  633. end)
  634.  
  635. test("cache.replace", {}, function()
  636. local part = Instance.new("Part")
  637. local fire = Instance.new("Fire")
  638. cache.replace(part, fire)
  639. assert(part ~= fire, "Part was not replaced with Fire")
  640. end)
  641.  
  642. test("cloneref", {}, function()
  643. local part = Instance.new("Part")
  644. local clone = cloneref(part)
  645. assert(part ~= clone, "Clone should not be equal to original")
  646. clone.Name = "Test"
  647. assert(part.Name == "Test", "Clone should have updated the original")
  648. end)
  649.  
  650. test("compareinstances", {}, function()
  651. local part = Instance.new("Part")
  652. local clone = cloneref(part)
  653. assert(part ~= clone, "Clone should not be equal to original")
  654. assert(compareinstances(part, clone), "Clone should be equal to original when using compareinstances()")
  655. end)
  656.  
  657. -- Closures
  658.  
  659. local function shallowEqual(t1, t2)
  660. if t1 == t2 then
  661. return true
  662. end
  663.  
  664. local UNIQUE_TYPES = {
  665. ["function"] = true,
  666. ["table"] = true,
  667. ["userdata"] = true,
  668. ["thread"] = true,
  669. }
  670.  
  671. for k, v in pairs(t1) do
  672. if UNIQUE_TYPES[type(v)] then
  673. if type(t2[k]) ~= type(v) then
  674. return false
  675. end
  676. elseif t2[k] ~= v then
  677. return false
  678. end
  679. end
  680.  
  681. for k, v in pairs(t2) do
  682. if UNIQUE_TYPES[type(v)] then
  683. if type(t2[k]) ~= type(v) then
  684. return false
  685. end
  686. elseif t1[k] ~= v then
  687. return false
  688. end
  689. end
  690.  
  691. return true
  692. end
  693.  
  694. test("checkcaller", {}, function()
  695. assert(checkcaller(), "Main scope should return true")
  696. end)
  697.  
  698. test("clonefunction", {}, function()
  699. local function test()
  700. return "success"
  701. end
  702. local copy = clonefunction(test)
  703. assert(test() == copy(), "The clone should return the same value as the original")
  704. assert(test ~= copy, "The clone should not be equal to the original")
  705. end)
  706.  
  707. test("getcallingscript", {})
  708.  
  709. test("getscriptclosure", {"getscriptfunction"}, function()
  710. local module = game:GetService("CoreGui").RobloxGui.Modules.Common.Constants
  711. local constants = getrenv().require(module)
  712. local generated = getscriptclosure(module)()
  713. assert(constants ~= generated, "Generated module should not match the original")
  714. assert(shallowEqual(constants, generated), "Generated constant table should be shallow equal to the original")
  715. end)
  716.  
  717. test("hookfunction", {"replaceclosure"}, function()
  718. local function test()
  719. return true
  720. end
  721. local ref = hookfunction(test, function()
  722. return false
  723. end)
  724. assert(test() == false, "Function should return false")
  725. assert(ref() == true, "Original function should return true")
  726. assert(test ~= ref, "Original function should not be same as the reference")
  727. end)
  728.  
  729. test("iscclosure", {}, function()
  730. assert(iscclosure(print) == true, "Function 'print' should be a C closure")
  731. assert(iscclosure(function() end) == false, "Executor function should not be a C closure")
  732. end)
  733.  
  734. test("islclosure", {}, function()
  735. assert(islclosure(print) == false, "Function 'print' should not be a Lua closure")
  736. assert(islclosure(function() end) == true, "Executor function should be a Lua closure")
  737. end)
  738.  
  739. test("isexecutorclosure", {"checkclosure", "isourclosure"}, function()
  740. assert(isexecutorclosure(isexecutorclosure) == true, "Did not return true for an executor global")
  741. assert(isexecutorclosure(newcclosure(function() end)) == true, "Did not return true for an executor C closure")
  742. assert(isexecutorclosure(function() end) == true, "Did not return true for an executor Luau closure")
  743. assert(isexecutorclosure(print) == false, "Did not return false for a Roblox global")
  744. end)
  745.  
  746. test("loadstring", {}, function()
  747. local animate = game:GetService("Players").LocalPlayer.Character.Animate
  748. local bytecode = getscriptbytecode(animate)
  749. local func = loadstring(bytecode)
  750. assert(type(func) ~= "function", "Luau bytecode should not be loadable!")
  751. assert(assert(loadstring("return ... + 1"))(1) == 2, "Failed to do simple math")
  752. assert(type(select(2, loadstring("f"))) == "string", "Loadstring did not return anything for a compiler error")
  753. end)
  754.  
  755. test("newcclosure", {}, function()
  756. local function test()
  757. return true
  758. end
  759. local testC = newcclosure(test)
  760. assert(test() == testC(), "New C closure should return the same value as the original")
  761. assert(test ~= testC, "New C closure should not be same as the original")
  762. assert(iscclosure(testC), "New C closure should be a C closure")
  763. end)
  764.  
  765. -- Console
  766.  
  767. test("rconsoleclear", {"consoleclear"})
  768.  
  769. test("rconsolecreate", {"consolecreate"})
  770.  
  771. test("rconsoledestroy", {"consoledestroy"})
  772.  
  773. test("rconsoleinput", {"consoleinput"})
  774.  
  775. test("rconsoleprint", {"consoleprint"})
  776.  
  777. test("rconsolesettitle", {"rconsolename", "consolesettitle"})
  778.  
  779. -- Crypt
  780.  
  781. test("crypt.base64encode", {"crypt.base64.encode", "crypt.base64_encode", "base64.encode", "base64_encode"}, function()
  782. assert(crypt.base64encode("test") == "dGVzdA==", "Base64 encoding failed")
  783. end)
  784.  
  785. test("crypt.base64decode", {"crypt.base64.decode", "crypt.base64_decode", "base64.decode", "base64_decode"}, function()
  786. assert(crypt.base64decode("dGVzdA==") == "test", "Base64 decoding failed")
  787. end)
  788.  
  789. test("crypt.encrypt", {}, function()
  790. local key = crypt.generatekey()
  791. local encrypted, iv = crypt.encrypt("test", key, nil, "CBC")
  792. assert(iv, "crypt.encrypt should return an IV")
  793. local decrypted = crypt.decrypt(encrypted, key, iv, "CBC")
  794. assert(decrypted == "test", "Failed to decrypt raw string from encrypted data")
  795. end)
  796.  
  797. test("crypt.decrypt", {}, function()
  798. local key, iv = crypt.generatekey(), crypt.generatekey()
  799. local encrypted = crypt.encrypt("test", key, iv, "CBC")
  800. local decrypted = crypt.decrypt(encrypted, key, iv, "CBC")
  801. assert(decrypted == "test", "Failed to decrypt raw string from encrypted data")
  802. end)
  803.  
  804. test("crypt.generatebytes", {}, function()
  805. local size = math.random(10, 100)
  806. local bytes = crypt.generatebytes(size)
  807. assert(#crypt.base64decode(bytes) == size, "The decoded result should be " .. size .. " bytes long (got " .. #crypt.base64decode(bytes) .. " decoded, " .. #bytes .. " raw)")
  808. end)
  809.  
  810. test("crypt.generatekey", {}, function()
  811. local key = crypt.generatekey()
  812. assert(#crypt.base64decode(key) == 32, "Generated key should be 32 bytes long when decoded")
  813. end)
  814.  
  815. test("crypt.hash", {}, function()
  816. local algorithms = {'sha1', 'sha384', 'sha512', 'md5', 'sha256', 'sha3-224', 'sha3-256', 'sha3-512'}
  817. for _, algorithm in ipairs(algorithms) do
  818. local hash = crypt.hash("test", algorithm)
  819. assert(hash, "crypt.hash on algorithm '" .. algorithm .. "' should return a hash")
  820. end
  821. end)
  822.  
  823. --- Debug
  824.  
  825. test("debug.getconstant", {}, function()
  826. local function test()
  827. print("Hello, world!")
  828. end
  829. assert(debug.getconstant(test, 1) == "print", "First constant must be print")
  830. assert(debug.getconstant(test, 2) == nil, "Second constant must be nil")
  831. assert(debug.getconstant(test, 3) == "Hello, world!", "Third constant must be 'Hello, world!'")
  832. end)
  833.  
  834. test("debug.getconstants", {}, function()
  835. local function test()
  836. local num = 5000 .. 50000
  837. print("Hello, world!", num, warn)
  838. end
  839. local constants = debug.getconstants(test)
  840. assert(constants[1] == 50000, "First constant must be 50000")
  841. assert(constants[2] == "print", "Second constant must be print")
  842. assert(constants[3] == nil, "Third constant must be nil")
  843. assert(constants[4] == "Hello, world!", "Fourth constant must be 'Hello, world!'")
  844. assert(constants[5] == "warn", "Fifth constant must be warn")
  845. end)
  846.  
  847. test("debug.getinfo", {}, function()
  848. local types = {
  849. source = "string",
  850. short_src = "string",
  851. func = "function",
  852. what = "string",
  853. currentline = "number",
  854. name = "string",
  855. nups = "number",
  856. numparams = "number",
  857. is_vararg = "number",
  858. }
  859. local function test(...)
  860. print(...)
  861. end
  862. local info = debug.getinfo(test)
  863. for k, v in pairs(types) do
  864. assert(info[k] ~= nil, "Did not return a table with a '" .. k .. "' field")
  865. assert(type(info[k]) == v, "Did not return a table with " .. k .. " as a " .. v .. " (got " .. type(info[k]) .. ")")
  866. end
  867. end)
  868.  
  869. test("debug.getproto", {}, function()
  870. local function test()
  871. local function proto()
  872. return true
  873. end
  874. end
  875. local proto = debug.getproto(test, 1, true)[1]
  876. local realproto = debug.getproto(test, 1)
  877. assert(proto, "Failed to get the inner function")
  878. assert(proto() == true, "The inner function did not return anything")
  879. if not realproto() then
  880. return "Proto return values are disabled on this executor"
  881. end
  882. end)
  883.  
  884. test("debug.getprotos", {}, function()
  885. local function test()
  886. local function _1()
  887. return true
  888. end
  889. local function _2()
  890. return true
  891. end
  892. local function _3()
  893. return true
  894. end
  895. end
  896. for i in ipairs(debug.getprotos(test)) do
  897. local proto = debug.getproto(test, i, true)[1]
  898. local realproto = debug.getproto(test, i)
  899. assert(proto(), "Failed to get inner function " .. i)
  900. if not realproto() then
  901. return "Proto return values are disabled on this executor"
  902. end
  903. end
  904. end)
  905.  
  906. test("debug.getstack", {}, function()
  907. local _ = "a" .. "b"
  908. assert(debug.getstack(1, 1) == "ab", "The first item in the stack should be 'ab'")
  909. assert(debug.getstack(1)[1] == "ab", "The first item in the stack table should be 'ab'")
  910. end)
  911.  
  912. test("debug.getupvalue", {}, function()
  913. local upvalue = function() end
  914. local function test()
  915. print(upvalue)
  916. end
  917. assert(debug.getupvalue(test, 1) == upvalue, "Unexpected value returned from debug.getupvalue")
  918. end)
  919.  
  920. test("debug.getupvalues", {}, function()
  921. local upvalue = function() end
  922. local function test()
  923. print(upvalue)
  924. end
  925. local upvalues = debug.getupvalues(test)
  926. assert(upvalues[1] == upvalue, "Unexpected value returned from debug.getupvalues")
  927. end)
  928.  
  929. test("debug.setconstant", {}, function()
  930. local function test()
  931. return "fail"
  932. end
  933. debug.setconstant(test, 1, "success")
  934. assert(test() == "success", "debug.setconstant did not set the first constant")
  935. end)
  936.  
  937. test("debug.setstack", {}, function()
  938. local function test()
  939. return "fail", debug.setstack(1, 1, "success")
  940. end
  941. assert(test() == "success", "debug.setstack did not set the first stack item")
  942. end)
  943.  
  944. test("debug.setupvalue", {}, function()
  945. local function upvalue()
  946. return "fail"
  947. end
  948. local function test()
  949. return upvalue()
  950. end
  951. debug.setupvalue(test, 1, function()
  952. return "success"
  953. end)
  954. assert(test() == "success", "debug.setupvalue did not set the first upvalue")
  955. end)
  956.  
  957. -- Filesystem
  958.  
  959. if isfolder and makefolder and delfolder then
  960. if isfolder(".tests") then
  961. delfolder(".tests")
  962. end
  963. makefolder(".tests")
  964. end
  965.  
  966. test("readfile", {}, function()
  967. writefile(".tests/readfile.txt", "success")
  968. assert(readfile(".tests/readfile.txt") == "success", "Did not return the contents of the file")
  969. end)
  970.  
  971. test("listfiles", {}, function()
  972. makefolder(".tests/listfiles")
  973. writefile(".tests/listfiles/test_1.txt", "success")
  974. writefile(".tests/listfiles/test_2.txt", "success")
  975. local files = listfiles(".tests/listfiles")
  976. assert(#files == 2, "Did not return the correct number of files")
  977. assert(isfile(files[1]), "Did not return a file path")
  978. assert(readfile(files[1]) == "success", "Did not return the correct files")
  979. makefolder(".tests/listfiles_2")
  980. makefolder(".tests/listfiles_2/test_1")
  981. makefolder(".tests/listfiles_2/test_2")
  982. local folders = listfiles(".tests/listfiles_2")
  983. assert(#folders == 2, "Did not return the correct number of folders")
  984. assert(isfolder(folders[1]), "Did not return a folder path")
  985. end)
  986.  
  987. test("writefile", {}, function()
  988. writefile(".tests/writefile.txt", "success")
  989. assert(readfile(".tests/writefile.txt") == "success", "Did not write the file")
  990. local requiresFileExt = pcall(function()
  991. writefile(".tests/writefile", "success")
  992. assert(isfile(".tests/writefile.txt"))
  993. end)
  994. if not requiresFileExt then
  995. return "This executor requires a file extension in writefile"
  996. end
  997. end)
  998.  
  999. test("makefolder", {}, function()
  1000. makefolder(".tests/makefolder")
  1001. assert(isfolder(".tests/makefolder"), "Did not create the folder")
  1002. end)
  1003.  
  1004. test("appendfile", {}, function()
  1005. writefile(".tests/appendfile.txt", "su")
  1006. appendfile(".tests/appendfile.txt", "cce")
  1007. appendfile(".tests/appendfile.txt", "ss")
  1008. assert(readfile(".tests/appendfile.txt") == "success", "Did not append the file")
  1009. end)
  1010.  
  1011. test("isfile", {}, function()
  1012. writefile(".tests/isfile.txt", "success")
  1013. assert(isfile(".tests/isfile.txt") == true, "Did not return true for a file")
  1014. assert(isfile(".tests") == false, "Did not return false for a folder")
  1015. assert(isfile(".tests/doesnotexist.exe") == false, "Did not return false for a nonexistent path (got " .. tostring(isfile(".tests/doesnotexist.exe")) .. ")")
  1016. end)
  1017.  
  1018. test("isfolder", {}, function()
  1019. assert(isfolder(".tests") == true, "Did not return false for a folder")
  1020. assert(isfolder(".tests/doesnotexist.exe") == false, "Did not return false for a nonexistent path (got " .. tostring(isfolder(".tests/doesnotexist.exe")) .. ")")
  1021. end)
  1022.  
  1023. test("delfolder", {}, function()
  1024. makefolder(".tests/delfolder")
  1025. delfolder(".tests/delfolder")
  1026. assert(isfolder(".tests/delfolder") == false, "Failed to delete folder (isfolder = " .. tostring(isfolder(".tests/delfolder")) .. ")")
  1027. end)
  1028.  
  1029. test("delfile", {}, function()
  1030. writefile(".tests/delfile.txt", "Hello, world!")
  1031. delfile(".tests/delfile.txt")
  1032. assert(isfile(".tests/delfile.txt") == false, "Failed to delete file (isfile = " .. tostring(isfile(".tests/delfile.txt")) .. ")")
  1033. end)
  1034.  
  1035. test("loadfile", {}, function()
  1036. writefile(".tests/loadfile.txt", "return ... + 1")
  1037. assert(assert(loadfile(".tests/loadfile.txt"))(1) == 2, "Failed to load a file with arguments")
  1038. writefile(".tests/loadfile.txt", "f")
  1039. local callback, err = loadfile(".tests/loadfile.txt")
  1040. assert(err and not callback, "Did not return an error message for a compiler error")
  1041. end)
  1042.  
  1043. test("dofile", {})
  1044.  
  1045. -- Input
  1046.  
  1047. test("isrbxactive", {"isgameactive"}, function()
  1048. assert(type(isrbxactive()) == "boolean", "Did not return a boolean value")
  1049. end)
  1050.  
  1051. test("mouse1click", {})
  1052.  
  1053. test("mouse1press", {})
  1054.  
  1055. test("mouse1release", {})
  1056.  
  1057. test("mouse2click", {})
  1058.  
  1059. test("mouse2press", {})
  1060.  
  1061. test("mouse2release", {})
  1062.  
  1063. test("mousemoveabs", {})
  1064.  
  1065. test("mousemoverel", {})
  1066.  
  1067. test("mousescroll", {})
  1068.  
  1069. -- Instances
  1070.  
  1071. test("fireclickdetector", {}, function()
  1072. local detector = Instance.new("ClickDetector")
  1073. fireclickdetector(detector, 50, "MouseHoverEnter")
  1074. end)
  1075.  
  1076. test("getcallbackvalue", {}, function()
  1077. local bindable = Instance.new("BindableFunction")
  1078. local function test()
  1079. end
  1080. bindable.OnInvoke = test
  1081. assert(getcallbackvalue(bindable, "OnInvoke") == test, "Did not return the correct value")
  1082. end)
  1083.  
  1084. test("getconnections", {}, function()
  1085. local types = {
  1086. Enabled = "boolean",
  1087. ForeignState = "boolean",
  1088. LuaConnection = "boolean",
  1089. Function = "function",
  1090. Thread = "thread",
  1091. Fire = "function",
  1092. Defer = "function",
  1093. Disconnect = "function",
  1094. Disable = "function",
  1095. Enable = "function",
  1096. }
  1097. local bindable = Instance.new("BindableEvent")
  1098. bindable.Event:Connect(function() end)
  1099. local connection = getconnections(bindable.Event)[1]
  1100. for k, v in pairs(types) do
  1101. assert(connection[k] ~= nil, "Did not return a table with a '" .. k .. "' field")
  1102. assert(type(connection[k]) == v, "Did not return a table with " .. k .. " as a " .. v .. " (got " .. type(connection[k]) .. ")")
  1103. end
  1104. end)
  1105.  
  1106. test("getcustomasset", {}, function()
  1107. writefile(".tests/getcustomasset.txt", "success")
  1108. local contentId = getcustomasset(".tests/getcustomasset.txt")
  1109. assert(type(contentId) == "string", "Did not return a string")
  1110. assert(#contentId > 0, "Returned an empty string")
  1111. assert(string.match(contentId, "rbxasset://") == "rbxasset://", "Did not return an rbxasset url")
  1112. end)
  1113.  
  1114. test("gethiddenproperty", {}, function()
  1115. local fire = Instance.new("Fire")
  1116. local property, isHidden = gethiddenproperty(fire, "size_xml")
  1117. assert(property == 5, "Did not return the correct value")
  1118. assert(isHidden == true, "Did not return whether the property was hidden")
  1119. end)
  1120.  
  1121. test("sethiddenproperty", {}, function()
  1122. local fire = Instance.new("Fire")
  1123. local hidden = sethiddenproperty(fire, "size_xml", 10)
  1124. assert(hidden, "Did not return true for the hidden property")
  1125. assert(gethiddenproperty(fire, "size_xml") == 10, "Did not set the hidden property")
  1126. end)
  1127.  
  1128. test("gethui", {}, function()
  1129. assert(typeof(gethui()) == "Instance", "Did not return an Instance")
  1130. end)
  1131.  
  1132. test("getinstances", {}, function()
  1133. assert(getinstances()[1]:IsA("Instance"), "The first value is not an Instance")
  1134. end)
  1135.  
  1136. test("getnilinstances", {}, function()
  1137. assert(getnilinstances()[1]:IsA("Instance"), "The first value is not an Instance")
  1138. assert(getnilinstances()[1].Parent == nil, "The first value is not parented to nil")
  1139. end)
  1140.  
  1141. test("isscriptable", {}, function()
  1142. local fire = Instance.new("Fire")
  1143. assert(isscriptable(fire, "size_xml") == false, "Did not return false for a non-scriptable property (size_xml)")
  1144. assert(isscriptable(fire, "Size") == true, "Did not return true for a scriptable property (Size)")
  1145. end)
  1146.  
  1147. test("setscriptable", {}, function()
  1148. local fire = Instance.new("Fire")
  1149. local wasScriptable = setscriptable(fire, "size_xml", true)
  1150. assert(wasScriptable == false, "Did not return false for a non-scriptable property (size_xml)")
  1151. assert(isscriptable(fire, "size_xml") == true, "Did not set the scriptable property")
  1152. fire = Instance.new("Fire")
  1153. assert(isscriptable(fire, "size_xml") == false, "⚠️⚠️ setscriptable persists between unique instances ⚠️⚠️")
  1154. end)
  1155.  
  1156. test("setrbxclipboard", {})
  1157.  
  1158. -- Metatable
  1159.  
  1160. test("getrawmetatable", {}, function()
  1161. local metatable = { __metatable = "Locked!" }
  1162. local object = setmetatable({}, metatable)
  1163. assert(getrawmetatable(object) == metatable, "Did not return the metatable")
  1164. end)
  1165.  
  1166. test("hookmetamethod", {}, function()
  1167. local object = setmetatable({}, { __index = newcclosure(function() return false end), __metatable = "Locked!" })
  1168. local ref = hookmetamethod(object, "__index", function() return true end)
  1169. assert(object.test == true, "Failed to hook a metamethod and change the return value")
  1170. assert(ref() == false, "Did not return the original function")
  1171. end)
  1172.  
  1173. test("getnamecallmethod", {}, function()
  1174. local method
  1175. local ref
  1176. ref = hookmetamethod(game, "__namecall", function(...)
  1177. if not method then
  1178. method = getnamecallmethod()
  1179. end
  1180. return ref(...)
  1181. end)
  1182. game:GetService("Lighting")
  1183. assert(method == "GetService", "Did not get the correct method (GetService)")
  1184. end)
  1185.  
  1186. test("isreadonly", {}, function()
  1187. local object = {}
  1188. table.freeze(object)
  1189. assert(isreadonly(object), "Did not return true for a read-only table")
  1190. end)
  1191.  
  1192. test("setrawmetatable", {}, function()
  1193. local object = setmetatable({}, { __index = function() return false end, __metatable = "Locked!" })
  1194. local objectReturned = setrawmetatable(object, { __index = function() return true end })
  1195. assert(object, "Did not return the original object")
  1196. assert(object.test == true, "Failed to change the metatable")
  1197. if objectReturned then
  1198. return objectReturned == object and "Returned the original object" or "Did not return the original object"
  1199. end
  1200. end)
  1201.  
  1202. test("setreadonly", {}, function()
  1203. local object = { success = false }
  1204. table.freeze(object)
  1205. setreadonly(object, false)
  1206. object.success = true
  1207. assert(object.success, "Did not allow the table to be modified")
  1208. end)
  1209.  
  1210. -- Miscellaneous
  1211.  
  1212. test("identifyexecutor", {"getexecutorname"}, function()
  1213. local name, version = identifyexecutor()
  1214. assert(type(name) == "string", "Did not return a string for the name")
  1215. return type(version) == "string" and "Returns version as a string" or "Does not return version"
  1216. end)
  1217.  
  1218. test("lz4compress", {}, function()
  1219. local raw = "Hello, world!"
  1220. local compressed = lz4compress(raw)
  1221. assert(type(compressed) == "string", "Compression did not return a string")
  1222. assert(lz4decompress(compressed, #raw) == raw, "Decompression did not return the original string")
  1223. end)
  1224.  
  1225. test("lz4decompress", {}, function()
  1226. local raw = "Hello, world!"
  1227. local compressed = lz4compress(raw)
  1228. assert(type(compressed) == "string", "Compression did not return a string")
  1229. assert(lz4decompress(compressed, #raw) == raw, "Decompression did not return the original string")
  1230. end)
  1231.  
  1232. test("messagebox", {})
  1233.  
  1234. test("queue_on_teleport", {"queueonteleport"})
  1235.  
  1236. test("request", {"http.request", "http_request"}, function()
  1237. local response = request({
  1238. Url = "https://httpbin.org/user-agent",
  1239. Method = "GET",
  1240. })
  1241. assert(type(response) == "table", "Response must be a table")
  1242. assert(response.StatusCode == 200, "Did not return a 200 status code")
  1243. local data = game:GetService("HttpService"):JSONDecode(response.Body)
  1244. assert(type(data) == "table" and type(data["user-agent"]) == "string", "Did not return a table with a user-agent key")
  1245. return "User-Agent: " .. data["user-agent"]
  1246. end)
  1247.  
  1248. test("setclipboard", {"toclipboard"})
  1249.  
  1250. test("setfpscap", {}, function()
  1251. local renderStepped = game:GetService("RunService").RenderStepped
  1252. local function step()
  1253. renderStepped:Wait()
  1254. local sum = 0
  1255. for _ = 1, 5 do
  1256. sum += 1 / renderStepped:Wait()
  1257. end
  1258. return math.round(sum / 5)
  1259. end
  1260. setfpscap(60)
  1261. local step60 = step()
  1262. setfpscap(0)
  1263. local step0 = step()
  1264. return step60 .. "fps @60 • " .. step0 .. "fps @0"
  1265. end)
  1266.  
  1267. -- Scripts
  1268.  
  1269. test("getgc", {}, function()
  1270. local gc = getgc()
  1271. assert(type(gc) == "table", "Did not return a table")
  1272. assert(#gc > 0, "Did not return a table with any values")
  1273. end)
  1274.  
  1275. test("getgenv", {}, function()
  1276. getgenv().__TEST_GLOBAL = true
  1277. assert(__TEST_GLOBAL, "Failed to set a global variable")
  1278. getgenv().__TEST_GLOBAL = nil
  1279. end)
  1280.  
  1281. test("getloadedmodules", {}, function()
  1282. local modules = getloadedmodules()
  1283. assert(type(modules) == "table", "Did not return a table")
  1284. assert(#modules > 0, "Did not return a table with any values")
  1285. assert(typeof(modules[1]) == "Instance", "First value is not an Instance")
  1286. assert(modules[1]:IsA("ModuleScript"), "First value is not a ModuleScript")
  1287. end)
  1288.  
  1289. test("getrenv", {}, function()
  1290. assert(_G ~= getrenv()._G, "The variable _G in the executor is identical to _G in the game")
  1291. end)
  1292.  
  1293. test("getrunningscripts", {}, function()
  1294. local scripts = getrunningscripts()
  1295. assert(type(scripts) == "table", "Did not return a table")
  1296. assert(#scripts > 0, "Did not return a table with any values")
  1297. assert(typeof(scripts[1]) == "Instance", "First value is not an Instance")
  1298. assert(scripts[1]:IsA("ModuleScript") or scripts[1]:IsA("LocalScript"), "First value is not a ModuleScript or LocalScript")
  1299. end)
  1300.  
  1301. test("getscriptbytecode", {"dumpstring"}, function()
  1302. local animate = game:GetService("Players").LocalPlayer.Character.Animate
  1303. local bytecode = getscriptbytecode(animate)
  1304. assert(type(bytecode) == "string", "Did not return a string for Character.Animate (a " .. animate.ClassName .. ")")
  1305. end)
  1306.  
  1307. test("getscripthash", {}, function()
  1308. local animate = game:GetService("Players").LocalPlayer.Character.Animate:Clone()
  1309. local hash = getscripthash(animate)
  1310. local source = animate.Source
  1311. animate.Source = "print('Hello, world!')"
  1312. task.defer(function()
  1313. animate.Source = source
  1314. end)
  1315. local newHash = getscripthash(animate)
  1316. assert(hash ~= newHash, "Did not return a different hash for a modified script")
  1317. assert(newHash == getscripthash(animate), "Did not return the same hash for a script with the same source")
  1318. end)
  1319.  
  1320. test("getscripts", {}, function()
  1321. local scripts = getscripts()
  1322. assert(type(scripts) == "table", "Did not return a table")
  1323. assert(#scripts > 0, "Did not return a table with any values")
  1324. assert(typeof(scripts[1]) == "Instance", "First value is not an Instance")
  1325. assert(scripts[1]:IsA("ModuleScript") or scripts[1]:IsA("LocalScript"), "First value is not a ModuleScript or LocalScript")
  1326. end)
  1327.  
  1328. test("getsenv", {}, function()
  1329. local animate = game:GetService("Players").LocalPlayer.Character.Animate
  1330. local env = getsenv(animate)
  1331. assert(type(env) == "table", "Did not return a table for Character.Animate (a " .. animate.ClassName .. ")")
  1332. assert(env.script == animate, "The script global is not identical to Character.Animate")
  1333. end)
  1334.  
  1335. test("getthreadidentity", {"getidentity", "getthreadcontext"}, function()
  1336. assert(type(getthreadidentity()) == "number", "Did not return a number")
  1337. end)
  1338.  
  1339. test("setthreadidentity", {"setidentity", "setthreadcontext"}, function()
  1340. setthreadidentity(3)
  1341. assert(getthreadidentity() == 3, "Did not set the thread identity")
  1342. end)
  1343.  
  1344. -- Drawing
  1345.  
  1346. test("Drawing", {})
  1347.  
  1348. test("Drawing.new", {}, function()
  1349. local drawing = Drawing.new("Square")
  1350. drawing.Visible = false
  1351. local canDestroy = pcall(function()
  1352. drawing:Destroy()
  1353. end)
  1354. assert(canDestroy, "Drawing:Destroy() should not throw an error")
  1355. end)
  1356.  
  1357. test("Drawing.Fonts", {}, function()
  1358. assert(Drawing.Fonts.UI == 0, "Did not return the correct id for UI")
  1359. assert(Drawing.Fonts.System == 1, "Did not return the correct id for System")
  1360. assert(Drawing.Fonts.Plex == 2, "Did not return the correct id for Plex")
  1361. assert(Drawing.Fonts.Monospace == 3, "Did not return the correct id for Monospace")
  1362. end)
  1363.  
  1364. test("isrenderobj", {}, function()
  1365. local drawing = Drawing.new("Image")
  1366. drawing.Visible = true
  1367. assert(isrenderobj(drawing) == true, "Did not return true for an Image")
  1368. assert(isrenderobj(newproxy()) == false, "Did not return false for a blank table")
  1369. end)
  1370.  
  1371. test("getrenderproperty", {}, function()
  1372. local drawing = Drawing.new("Image")
  1373. drawing.Visible = true
  1374. assert(type(getrenderproperty(drawing, "Visible")) == "boolean", "Did not return a boolean value for Image.Visible")
  1375. local success, result = pcall(function()
  1376. return getrenderproperty(drawing, "Color")
  1377. end)
  1378. if not success or not result then
  1379. return "Image.Color is not supported"
  1380. end
  1381. end)
  1382.  
  1383. test("setrenderproperty", {}, function()
  1384. local drawing = Drawing.new("Square")
  1385. drawing.Visible = true
  1386. setrenderproperty(drawing, "Visible", false)
  1387. assert(drawing.Visible == false, "Did not set the value for Square.Visible")
  1388. end)
  1389.  
  1390. test("cleardrawcache", {}, function()
  1391. cleardrawcache()
  1392. end)
  1393.  
  1394. -- WebSocket
  1395.  
  1396. test("WebSocket", {})
  1397.  
  1398. test("WebSocket.connect", {}, function()
  1399. local types = {
  1400. Send = "function",
  1401. Close = "function",
  1402. OnMessage = {"table", "userdata"},
  1403. OnClose = {"table", "userdata"},
  1404. }
  1405. local ws = WebSocket.connect("ws://echo.websocket.events")
  1406. assert(type(ws) == "table" or type(ws) == "userdata", "Did not return a table or userdata")
  1407. for k, v in pairs(types) do
  1408. if type(v) == "table" then
  1409. assert(table.find(v, type(ws[k])), "Did not return a " .. table.concat(v, ", ") .. " for " .. k .. " (a " .. type(ws[k]) .. ")")
  1410. else
  1411. assert(type(ws[k]) == v, "Did not return a " .. v .. " for " .. k .. " (a " .. type(ws[k]) .. ")")
  1412. end
  1413. end
  1414. ws:Close()
  1415. end)
  1416. ---------------
  1417. printidentity()
  1418.  
  1419.  
Add Comment
Please, Sign In to add comment