Advertisement
AstnU

Doors OP Script 2024

Sep 26th, 2024
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.34 KB | Gaming | 0 0
  1. Script:
  2.  
  3. local compatibility_mode = false do
  4. local executor_name = identifyexecutor and identifyexecutor() or "your executor"
  5.  
  6. -- Known executors that do not support the functions
  7. if executor_name == "Solara" then compatibility_mode = true end
  8.  
  9. -- Function replacement
  10. if not fireproximityprompt or executor_name == "Solara" then
  11. function newinstance(itype, iparent, iproperties)
  12. if not itype or typeof(itype) ~= 'string' then return; end
  13. if typeof(iparent) ~= 'Instance' then iparent = nil; end
  14.  
  15. local i = Instance.new(itype, iparent)
  16. if iproperties and typeof(iproperties) == 'table' then
  17. for property, value in pairs(iproperties) do
  18. pcall(function() i[property] = value end)
  19. end
  20. end
  21.  
  22. return i
  23. end
  24.  
  25. function posprompt(prompt, enabled)
  26. local camcf, part = workspace.CurrentCamera.CFrame, nil
  27. if prompt.Parent.Name == '_pxpart' then part = prompt.Parent; end
  28. if prompt.Parent:FindFirstChild('_pxpart') then part = prompt.Parent:FindFirstChild('_pxpart'); end
  29. if not part then
  30. part = newinstance('Part', prompt.Parent, {Name = '_pxpart', Transparency = 1, CanCollide = false, CanTouch = false, CanQuery = false, Size = Vector3.new(0.5, 0.5, 0.5), Shape = 'Ball', Anchored = true})
  31. end
  32. part.CFrame = camcf + (camcf.lookVector * 1.4)
  33. if enabled == true then prompt.Parent = part; end
  34. if enabled == false and prompt.Parent.Name == '_pxpart' then prompt.Parent = prompt.Parent.Parent; end
  35. end
  36.  
  37. function _fireproxp(obj)
  38. local oldenabled, oldrlos = obj.Enabled, obj.RequiresLineOfSight
  39. obj.Enabled = true; obj.RequiresLineOfSight = false
  40. local PromptTime = obj.HoldDuration
  41. obj.HoldDuration = 0; posprompt(obj, true)
  42. task.wait()
  43. obj:InputHoldBegin()
  44. obj:InputHoldEnd()
  45. posprompt(obj, false); obj.HoldDuration = PromptTime; obj.Enabled = oldenabled; obj.RequiresLineOfSight = oldrlos
  46. end
  47.  
  48. fireproximityprompt = _fireproxp
  49. getgenv().fireproximityprompt = _fireproxp
  50. end
  51.  
  52. function test(name: string, func: () -> (), ...)
  53. if compatibility_mode then return end
  54.  
  55. local success, error_msg = pcall(func, ...)
  56.  
  57. if not success then
  58. compatibility_mode = true
  59. print("mspaint: " .. executor_name .. " does not support " .. name .. ", falling back to compatibility mode")
  60. end
  61.  
  62. return success
  63. end
  64.  
  65. test("require", function() require(game:GetService("ReplicatedStorage"):FindFirstChildWhichIsA("ModuleScript", true)) end)
  66. test("hookmetamethod", function()
  67. -- From UNC Env Check
  68. local object = setmetatable({}, { __index = newcclosure(function() return false end), __metatable = "Locked!" })
  69. local ref = hookmetamethod(object, "__index", function() return true end)
  70. assert(object.test == true, "Failed to hook a metamethod and change the return value")
  71. assert(ref() == false, "Did not return the original function")
  72.  
  73. local method, ref; ref = hookmetamethod(game, "__namecall", function(...)
  74. if not method then
  75. method = getnamecallmethod()
  76. end
  77. return ref(...)
  78. end)
  79.  
  80. game:GetService("Lighting")
  81. assert(method == "GetService", "Did not get the correct method (GetService)")
  82. end)
  83.  
  84. test("firesignal", function()
  85. local event = Instance.new("BindableEvent")
  86.  
  87. local fired = false
  88. event.Event:Connect(function(value) fired = value end)
  89.  
  90. if firesignal then
  91. firesignal(event.Event, true)
  92. task.wait()
  93. end
  94.  
  95. if not fired then
  96. for _, connection in pairs(getconnections(event.Event)) do
  97. connection:Fire(true)
  98. end
  99.  
  100. task.wait()
  101. end
  102.  
  103. event:Destroy()
  104. assert(fired, "Failed to fire a BindableEvent")
  105. end)
  106. end
  107.  
  108. loadstring(game:HttpGet("https://raw.githubusercontent.com/notpoiu/mspaint/" .. (compatibility_mode and "solara" or "main") .. "/places/" .. game.GameId .. ".lua"))()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement