Oooof. I don’t have the original script from months ago, but I decided to try to recreate if from memory. I’ve tested it, but like I’ve said in my previous posts, it isn’t very consistent.
--Services
local tweenService = game:GetService("TweenService")
local debris = game:GetService("Debris")
local captureService = game:GetService("CaptureService")
--Settings
local config = {
fade_in = 0.001, --The time it takes for the screenshot/image to fade in (high values aren't recommend)
fade_in_easingStyle = Enum.EasingStyle.Cubic,
fade_in_easingDirection = Enum.EasingDirection.Out,
fade_out = 1, --The time it takes for the screenshot/image to fade out. High values make the image blurier
fade_out_easingStyle = Enum.EasingStyle.Quad,
fade_out_easingDirection = Enum.EasingDirection.In,
starting_transparency = .97, --The starting imageTransparency of the image
images_per_seconds = 60, --the amount of new screenshots to create per second. The higher the value, the better the image quality, but the more likely it is to fail.
}
local screenGui = script.Parent.Screenshots --Change directory to where you want the motion blur to appear. Ideally, if you set it to a UIObject or Folder, you would want it to cover the entire screen.
--[[
the ScreenGui must have these properties enabled/disabled
> ClipToDeviceSafeArea = false
> SafeAreaCompatibility = None
> ScreenInsets = None
> IgnoreGuiInset = false
]]
local imageLabel_template = Instance.new("ImageLabel")
imageLabel_template.Position = UDim2.fromScale(.5,.5)
imageLabel_template.AnchorPoint = Vector2.one*.5
imageLabel_template.BackgroundTransparency = 1
imageLabel_template.Size = UDim2.fromScale(1,1)
imageLabel_template.ScaleType = Enum.ScaleType.Fit
imageLabel_template.ImageTransparency = 1
local fade_In_tweenInfo = TweenInfo.new(config.fade_in, config.fade_in_easingStyle, config.fade_in_easingDirection, 0, false, 0)
local fade_Out_tweenInfo = TweenInfo.new(config.fade_out, config.fade_out_easingStyle, config.fade_out_easingDirection, 0, false, 0)
--Create a new image label with the specified imageId, animates the fade out.
local function CreateNewUI(imageId: string): ImageLabel
local imageLabel = imageLabel_template:Clone()
imageLabel.Image = imageId
imageLabel.Parent = screenGui
tweenService:Create(imageLabel, fade_In_tweenInfo, {ImageTransparency = config.starting_transparency}):Play()
task.wait(fade_In_tweenInfo.Time+fade_In_tweenInfo.DelayTime)
tweenService:Create(imageLabel, fade_Out_tweenInfo, {ImageTransparency = 1}):Play()
debris:AddItem(imageLabel, fade_Out_tweenInfo.Time+fade_In_tweenInfo.DelayTime)
return imageLabel --If needed for some reason
end
local enabled = false --Enable or disable it
task.delay(5, function() --Enable the motion blur after 5 seconds for demonstration
enabled = true
end)
--Motion blur loop
while true do
task.wait(1/config.images_per_seconds)
if not enabled then
continue --If the motion blur isn't enabled, then skip the following code.
end
task.spawn(function()
print("attempt screenshot")
captureService:CaptureScreenshot(CreateNewUI)
end)
end
Make sure to put this into a local script, and create a screengui so that the blur effect can be displayed
EDIT: You should also probably disable any ui before screenshotting so that it doesn’t leave any blur of the ui in the screen.