Jxjxjx1

Doors Script [mspaint V2]

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