Decal Jumpscare always shows a white screen before popping out

Anybody knows where is the issue on my script? The Decal are always showed up a white screen everytime I want to trigger the jumpscare before it showed up (sometimes)

This would be the script:

local debounce = false

script.Parent.Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild('Humanoid') and not debounce then
		debounce = true
		local player = game.Players:GetPlayerFromCharacter(hit.Parent)
		if player then
			local humanoid = hit.Parent:FindFirstChild("Humanoid")
			if humanoid then
				humanoid.Health = 0 -- Kill the player
				wait(0.1) -- Wait for a brief moment before triggering jumpscare
				local playerGui = player:FindFirstChild("PlayerGui")
				if playerGui then
					local jumpscareGUI = playerGui:FindFirstChild("Jumpscare")
					if jumpscareGUI then
						-- Delay the enabling of the jumpscare GUI by a short period
						wait(0.1)
						jumpscareGUI.Enabled = true
						wait(2)
						jumpscareGUI.Enabled = false -- Corrected line to disable the jumpscare GUI
					end
				end
			end
		end
		debounce = false -- Reset the debounce flag after the wait period
	end
end)

This probably happens because when ScreenGuis aren’t enabled or get disabled, all the images inside of them aren’t loaded. When you enable the “JumpscareGui”, the image inside of it has to be loaded and it takes some time before it can be shown. The “white screen” you mentioned is the jumpscare ImageLabel background color.

What you can do is setting the ImageLabel property Visible to true, instead of changing the ScreenGui properties.

1 Like

OH. i actually figured it by now, i made the ImageLabel’s background color transparency into 1. that actually help me. thanks.

1 Like

You can set my reply as the solution, so if other people will have the same problem in the future they’ll know what to do

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.