Help making a black-out screen

Hey devs,

I need help making a blackout screen!
This is my code:

function blackout()
	game.StarterGui.CutScene.BlackScreen.BackgroundTransparency = 0.9
	wait(0.1)
	game.StarterGui.CutScene.BlackScreen.BackgroundTransparency = 0.8
	wait(0.1)
	game.StarterGui.CutScene.BlackScreen.BackgroundTransparency = 0.7
	wait(0.1)
	game.StarterGui.CutScene.BlackScreen.BackgroundTransparency = 0.6
	wait(0.1)
	game.StarterGui.CutScene.BlackScreen.BackgroundTransparency = 0.5
	wait(0.1)
	game.StarterGui.CutScene.BlackScreen.BackgroundTransparency = 0.4
	wait(0.1)
	game.StarterGui.CutScene.BlackScreen.BackgroundTransparency = 0.3
	wait(0.1)
	game.StarterGui.CutScene.BlackScreen.BackgroundTransparency = 0.2
	wait(0.1)
	game.StarterGui.CutScene.BlackScreen.BackgroundTransparency = 0.1
	wait(0.1)
	game.StarterGui.CutScene.BlackScreen.BackgroundTransparency = 0
	
	game.StarterGui.CutScene.BlackScreen.Text.TextColor3 = Color3.new(0.760784, 0.760784, 0.760784)
	game.StarterGui.CutScene.BlackScreen.Text.Value = "Welcome, traveler, to the unknown.."
	game.StarterGui.CutScene.BlackScreen.Text.TextTransparency = 0
	wait(2.5)
	game.StarterGui.CutScene.BlackScreen.Text.Value = "No one knows what lays here.. so be careful."
	wait(4.5)
	game.StarterGui.CutScene.BlackScreen.Text.TextColor3 = Color3.new(1, 0.270588, 0.282353)
	game.StarterGui.CutScene.BlackScreen.Text.Value = "You could encounter anything on your journey to the surface.."
	wait(5)
	game.StarterGui.CutScene.BlackScreen.Text.TextColor3 = Color3.new(0.760784, 0.760784, 0.760784)
	game.StarterGui.CutScene.BlackScreen.Text.Value = "Stay safe, traveler."
end 

script.Parent.ClickDetector.MouseClick:Connect(blackout()

And I get no errors on the output bar,
This is my explorer tab:
screenshot(19)

And this is my ScreenGui:
screenshot(20)

Thanks for your help if you commented!

script.Parent.ClickDetector.MouseClick:Connect(blackout())
change it into
script.Parent.ClickDetector.MouseClick:Connect(blackout()

2 Likes

Thanks, but it still doesn’t work. I see where you get your point, and that is probably true. But the whole main thing is for it to black out and then some text appears. Any other ideas?

oh wait i just noticed the bug (will reply again…)

1 Like

Yes, what is the bug? I honestly don’t think anything is wrong; but that’s just my opinion. I am a basic-scripter not an advanced or intermediate.

local Player = game.Players.LocalPlayer
local Blackscreen = Player.PlayerGui:WaitForChild("CutScene").BlackScreen

local function Blackout()
	for i = 1, 10 do 
		Blackscreen.BackgroundTransparency -= 0.1
	end
	
	Blackscreen.Text.TextColor3 = Color3.new(0.760784, 0.760784, 0.760784)
	Blackscreen.Text.Value = "Welcome, traveler, to the unknown.."
	Blackscreen.Text.TextTransparency = 0
	task.wait(2.5)
	Blackscreen.Text.Value = "No one knows what lays here.. so be careful."
	task.wait(4.5)
	Blackscreen.Text.TextColor3 = Color3.new(1, 0.270588, 0.282353)
	Blackscreen.Text.Value = "You could encounter anything on your journey to the surface.."
	task.wait(5)
	Blackscreen.Text.TextColor3 = Color3.new(0.760784, 0.760784, 0.760784)
	Blackscreen.Text.Value = "Stay safe, traveler."
end

script.Parent.ClickDetector.MouseClick:Connect(function()
	Blackout()
end)
1 Like

I’ll try that! Thanks for the reply.

local Players = game.Players:GetPlayers()
function blackout(player)
		player.PlayerGui.CutScene.BlackScreen.BackgroundTransparency = 0.9
		wait(0.1)
	player.PlayerGui.CutScene.BlackScreen.BackgroundTransparency = 0.8
		wait(0.1)
	player.PlayerGui.CutScene.BlackScreen.BackgroundTransparency = 0.7
		wait(0.1)
	player.PlayerGui.CutScene.BlackScreen.BackgroundTransparency = 0.6
		wait(0.1)
	player.PlayerGui.CutScene.BlackScreen.BackgroundTransparency = 0.5
		wait(0.1)
	player.PlayerGui.CutScene.BlackScreen.BackgroundTransparency = 0.4
		wait(0.1)
	player.PlayerGui.CutScene.BlackScreen.BackgroundTransparency = 0.3
		wait(0.1)
	player.PlayerGui.CutScene.BlackScreen.BackgroundTransparency = 0.2
		wait(0.1)
	player.PlayerGui.CutScene.BlackScreen.BackgroundTransparency = 0.1
		wait(0.1)
	player.PlayerGui.CutScene.BlackScreen.BackgroundTransparency = 0

		player.PlayerGui.CutScene.BlackScreen.Text.TextColor3 = Color3.new(0.760784, 0.760784, 0.760784)
		player.PlayerGui.CutScene.BlackScreen.Text.Value = "Welcome, traveler, to the unknown.."
		player.PlayerGui.CutScene.BlackScreen.Text.TextTransparency = 0
		wait(2.5)
		player.PlayerGui.CutScene.BlackScreen.Text.Value = "No one knows what lays here.. so be careful."
		wait(4.5)
		player.PlayerGui.CutScene.BlackScreen.Text.TextColor3 = Color3.new(1, 0.270588, 0.282353)
		player.PlayerGui.CutScene.BlackScreen.Text.Value = "You could encounter anything on your journey to the surface.."
		wait(5)
		player.PlayerGui.CutScene.BlackScreen.Text.TextColor3 = Color3.new(0.760784, 0.760784, 0.760784)
		player.PlayerGui.CutScene.BlackScreen.Text.Value = "Stay safe, traveler."
end 
for i = 1,#Players do
	blackout(Players[i])
end
1 Like

Sorry, but that doesn’t work. And there is no errors in the output bar.

This doesn’t work either… I think my game is broken. Do you want some footage?

are u sure u named everything correctly in the guis

Yep, I hope so! There might be a error in it…

Did you forget the script.Parent.ClickDetector.MouseClick:Connect(blackout() at the end?

is it trying to change text’s transparency frame since player.PlayerGui.CutScene.BlackScreen.Text.Value = "No one knows what lays here.. so be careful."
(change value to Text)

Glad to see poeple are still using wait with transparency changes despite TweenService being a thing.

local TS = game:GetService("TweenService")
TS:Create(BlackScreen, Tweeninfo.new(1), {BackgroundTransparency = 1}):Play()

Also localscripts don’t work in workspace.

Oh… Should I change it to be a script? But then it becomes for everyone?

Just put in startercharacter and reference part there.
Also not to mention you can use FireAllClients or FireClient.

I’m confused, I don’t understand where to put that.

local Part = workspace:FindFirstChild("ClickableButton"):WaitForChild["Press Part"]
local TS = game:GetService("TweenService")
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local Char = LocalPlayer.Character
local v1 = nil
local Screen = LocalPlayer:WaitForChild("PlayerGui"):WaitForChild("CutScene") 
local Frame = LocalPlayer:WaitForChild("PlayerGui"):WaitForChild("CutScene"):WaitForChild("BlackScreen") -- frame to change bg transparency

function blackout()
		v1 = TS:Create(Frame, TweenInfo.new(1), {BackgroundTransparency = 0}):Play()
	
	Screen.BlackScreen.Text.TextColor3 = Color3.new(0.760784, 0.760784, 0.760784)
	Screen.BlackScreen.Text.Value = "Welcome, traveler, to the unknown.."
	Screen.BlackScreen.Text.TextTransparency = 0
	wait(2.5)
	Screen.BlackScreen.Text.Value = "No one knows what lays here.. so be careful."
	wait(4.5)
	Screen.BlackScreen.Text.TextColor3 = Color3.new(1, 0.270588, 0.282353)
	Screen.BlackScreen.Text.Value = "You could encounter anything on your journey to the surface.."
	wait(5)
	Screen.BlackScreen.Text.TextColor3 = Color3.new(0.760784, 0.760784, 0.760784)
	Screen.BlackScreen.Text.Value = "Stay safe, traveler."
end 

Part.ClickDetector.MouseClick:Connect(blackout)

This is a localscript located OUTSIDE workspace
Make sure the CutScene is PARENTED IN PLAYERGUI
This can be achieved by using

Screen.Parent = LocalPlayer:WaitForChild("PlayerGui") -- Screen  is CutScence
1 Like

You put script.Parent.ClickDetector.MouseClick:Connect(blackout()
Try out script.Parent.ClickDetector.MouseClick:Connect(blackout)

maybe this helps!

1 Like

Alright so in StarterPlayerScripts? And would the button stay where it is?