Advertisement
Mangus875

Roblox Doors Brute Force Door 50 Exploit Script

Mar 27th, 2023 (edited)
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.97 KB | None | 0 0
  1. local updateCode = Instance.new("Event")    -- CONNECT GETTING A NEW BOOK OR EXITING THE LIBRARY TO THIS
  2.  
  3. local function getKnownCode()   -- updateCode.Event:Connect(function() bruteForceCode(getKnownCode()) end)
  4.     --[[
  5.         1) Get paper shapes
  6.         2) Get known shapes from Gui
  7.         3) Translate that information into a string where unknown digits are marked with an underscore
  8.         4) Return that string
  9.     --]]
  10. end
  11.  
  12. ----
  13. local digit = {}
  14. function digit.new(num)
  15.     local digitClass = {}
  16.    
  17.     --Variables
  18.     digitClass.Val = num or 0
  19.    
  20.     --Methods
  21.     if not num then
  22.         function digitClass:Iterate()
  23.             self.Val = (self.Val+1) % 10
  24.             return self.Val, (self.Val == 0)
  25.         end
  26.     else
  27.         function digitClass:Iterate()
  28.             return self.Val, true
  29.         end
  30.     end
  31.    
  32.     return digitClass
  33. end
  34.  
  35. local function getPossibleCodes(known, attempts)
  36.     if #known ~= 5 then error("code '"..known.."' is invalid: code should be 5 digits") end
  37.     ---
  38.     local digits = {}   -- digits
  39.    
  40.     for d = 1, #known do
  41.         local c = known:sub(d,d)
  42.         if c == "_" then
  43.             table.insert(digits, digit.new())
  44.         else
  45.             table.insert(digits, digit.new(tonumber(c)))
  46.         end
  47.     end
  48.    
  49.     local codes = {}
  50.     for a = 1, attempts do
  51.         local code = ""
  52.         local iterateNext = true
  53.         for i, d in pairs(digits) do
  54.             if iterateNext then
  55.                 local val, next = d:Iterate()
  56.                 iterateNext = next
  57.                 code = code..tostring(val)
  58.             else
  59.                 local val = d.Val
  60.                 code = code..tostring(val)
  61.             end
  62.         end
  63.         table.insert(codes, code)
  64.     end
  65.    
  66.     return codes
  67. end
  68.  
  69. local function bruteForceCode(known)
  70.     local unknown = 0
  71.     for i = 0, #known do
  72.         if known:sub(i,i) == "_" then
  73.             unknown = unknown+1
  74.         end
  75.     end
  76.    
  77.     local exitLoop = false
  78.     updateCode.Event:Connect(function()
  79.         exitLoop = true
  80.     end)
  81.     for _, code in pairs(getPossibleCodes(known, 10^unknown)) do
  82.         game.ReplicatedStorage.EntityInfo.PL:FireServer(code)
  83.         task.wait()
  84.         ---
  85.         if exitLoop then break end
  86.     end
  87. end
  88.  
  89. updateCode.Event:Connect(function()
  90.     bruteForceCode(getKnownCode())
  91. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement