What solutions have you tried so far? I tried looking into the documentation and it did not help, I did not found any post talking about these 2 features.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
local cooldown = 3
local equiping = false
local tool = script.Parent
local camera = game.Workspace.CurrentCamera
local capserv = game:GetService("CaptureService")
local uis = game:GetService("UserInputService")
local StarterGui = game:GetService("StarterGui")
local player = game.Players.LocalPlayer
capserv.CaptureBegan:Connect(function()
print("OK IM CHANGINGGGG 🐺🐺") -- didnt print
game.Lighting.GlobalShadows = false
game.Lighting.Brightness = 1000000
end)
capserv.CaptureEnded:Connect(function()
print("ok im back to normal 🐺-▶👨") -- this also did not print
game.Lighting.GlobalShadows = true
game.Lighting.Brightness = 0
end)
local function OnCaptureReady(contentid)
script.Parent.Handle.Screen.SurfaceGui.ImageLabel.Image = contentid
camera.CameraType = Enum.CameraType.Custom
end
tool.Equipped:Connect(function()
equiping = true
while equiping do
capserv:CaptureScreenshot()
task.wait(cooldown)
end
end)
tool.Unequipped:Connect(function()
equiping = false
end)
I have a feeling its because i misunderstood how it suppose to work?
I would just enable your lighting effects right before :CaptureScreenshot(), then disable them in the callback. That seems to be the implied flow with the current API.
The reason your CaptureBegan and CaptureEnded events arent firing is because those signals are only meant for user-initiated captures (like when a player presses a system screenshot keybind). When you use :CaptureScreenshot() in code, the developer is in full control of the timing… so Roblox dosent fire those events. Thats why your prints never showed.
Configure your scene right before calling CaptureScreenshot()
Use the onCaptureReady callback to know when the capture has completed and then restore your settings
That means youll need to treat your own function call as the “CaptureBegan” and the callback as your “CaptureEnded”
local cooldown = 3
local equipping = false
local tool = script.Parent
local capserv = game:GetService("CaptureService")
local camera = workspace.CurrentCamera
-- custom functions to mimic Begin/End
local function onCaptureBegan()
print("Custom CaptureBegan")
-- apply lighting or any other effects here
game.Lighting.GlobalShadows = false
game.Lighting.Brightness = 1000000
end
local function onCaptureEnded(contentId)
print("Custom CaptureEnded")
-- restore lighting after capture
game.Lighting.GlobalShadows = true
game.Lighting.Brightness = 0
tool.Handle.Screen.SurfaceGui.ImageLabel.Image = contentId
-- reset camera if needed
camera.CameraType = Enum.CameraType.Custom
end
tool.Equipped:Connect(function()
equipping = true
while equipping do
onCaptureBegan() -- trigger effects before capture
capserv:CaptureScreenshot(onCaptureEnded) -- pass callback
task.wait(cooldown)
end
end)
tool.Unequipped:Connect(function()
equipping = false
end)
So the “workaround” is just to manage those states manually. That way you still get the same behavior, even though the built-in events dont apply to developer-initiated screenshots.