Transition Fade and Timer not working

I am making a story game, and I ran into a problem. The transition teleports them to the house, but it doesn’t darken the screen to make it more realistic. This is what it does:

I’m also having trouble with the timer, it doesn’t appear after the character leaves and the monster appears.

I would be grateful if anyone could give me advice on how to fix these problems. Your feedback is appreciated as well. Thanks.

1 Like

The time video, I changed the script a little bit so the server tells the players to survive. But the timer is still broken.

1 Like

Not really able to help you unless you show relevant code and errors. If it’s only a video to work off of then there’s no actual substance to point you towards what’s actually wrong and how to fix that.

2 Likes

Here is the main script of the game:

local createDialogueEvent = game.ReplicatedStorage.Remotes.createDialogueEvent
local hideDialogueEvent = game.ReplicatedStorage.Remotes.hideDialogueEvent
local setDialogueImageEvent = game.ReplicatedStorage.Remotes.setDialogueImageEvent
local TransitionEvent = game.ReplicatedStorage.TransitionEvent
local playSoundEvent = game.ReplicatedStorage.Remotes.playSoundEvent
local stopSoundsEvent = game.ReplicatedStorage.Remotes.stopSoundEvent
local cameraInterpolateEvent = game.ReplicatedStorage.Remotes.cameraInterpolateEvent
local cameraToPlayerEvent = game.ReplicatedStorage.Remotes.cameraToPlayerEvent
local TimerEvent = game.ReplicatedStorage.TimerEvent

local randomCharacter
local randomCharacterName

local happy_music = “rbxassetid://623568327”
local calm_music = “rbxassetid://2895698245”
local danger_music = “rbxassetid://5555617677”
local scary_music = “rbxassetid://3478615832”
local scary_music2 = “rbxassetid://4064703894”
local badend_music = “rbxassetid://799326768”
local goodend_music = “rbxassetid://669763953”
local power_down = “rbxassetid://3250635272”

local function getRandomCharacter()

local players = game.Players:GetPlayers()

repeat
	local number = math.random(1,#players)
	local randomPlayer = players[number]
	randomCharacter = randomPlayer.Character
until randomCharacter

randomCharacterName = randomCharacter.Name
randomCharacter.Archivable = true

function teleportPlayers(partCFrame)
	local players = game.Players:getPlayers()
	for _,player in pairs(players) do
		if player.Character then
			if player.Character.HumanoidRootPart.Anchored == false then
				player.Character.Humanoid.Jump = true
			end
		end
	end
	wait(.5)
	for _,player in pairs(players) do
		if player.Character then
			if player.Character.HumanoidRootPart.Anchored == false then
				player.Character:SetPrimaryPartCFrame(partCFrame)
			end
		end
	end
end

end

wait(10)
playSoundEvent:FireAllClients(happy_music,0)
setDialogueImageEvent:FireAllClients(game.Workspace.Miles, Color3.new(0, 0, 1))

createDialogueEvent:FireAllClients("")

wait(0.5)

createDialogueEvent:FireAllClients(“Hello!!”)

wait(5)

getRandomCharacter()
setDialogueImageEvent:FireAllClients(randomCharacter, Color3.new(0.666667, 0, 1))
createDialogueEvent:FireAllClients(“Hi!”)

wait(5)

setDialogueImageEvent:FireAllClients(game.Workspace.Miles, Color3.new(0, 0, 1))

createDialogueEvent:FireAllClients(“It is very nice to meet you all, the name is Miles!”)

wait(5)

getRandomCharacter()
setDialogueImageEvent:FireAllClients(randomCharacter, Color3.new(0.666667, 0, 1))
createDialogueEvent:FireAllClients("Nice to meet you too! My name is " … randomCharacterName)

wait(5)

setDialogueImageEvent:FireAllClients(game.Workspace.Miles, Color3.new(0, 0, 1))

createDialogueEvent:FireAllClients(“Why don’t you all go explore the neighborhood a bit, for your curiousity.”)

wait(5)

hideDialogueEvent:FireAllClients()

wait(20)

setDialogueImageEvent:FireAllClients(game.Workspace.Miles, Color3.new(0, 0, 1))

createDialogueEvent:FireAllClients("")

wait(0.5)

createDialogueEvent:FireAllClients(“It is beginning to get late, why don’t we head inside?”)

wait(5)

hideDialogueEvent:FireAllClients()

TransitionEvent:FireAllClients()
wait(3)
teleportPlayers(game.Workspace.houseTeleport.CFrame)
stopSoundsEvent:FireAllClients()
playSoundEvent:FireAllClients(calm_music,0)
game.Lighting.TimeOfDay = “17:54:00”
game.Workspace.Miles:Destroy()
wait(0)
local npc2 = game.ReplicatedStorage.Miles:Clone()
npc2.Parent = game.Workspace

wait(5)

setDialogueImageEvent:FireAllClients(game.Workspace.Miles, Color3.new(0, 0, 1))

createDialogueEvent:FireAllClients("")

wait(0.5)

createDialogueEvent:FireAllClients(“You guys wanna watch some TV?”)

wait(5)

getRandomCharacter()
setDialogueImageEvent:FireAllClients(randomCharacter, Color3.new(0.666667, 0, 1))
createDialogueEvent:FireAllClients(“We would love to, I wonder whats on right now.”)

wait(5)

setDialogueImageEvent:FireAllClients(game.Workspace.Miles, Color3.new(0, 0, 1))

createDialogueEvent:FireAllClients(“Lets look and see if their is any on.”)
cameraInterpolateEvent:FireAllClients(game.Workspace.CameraGroup.CameraPart.CFrame,game.Workspace.CameraGroup.TargetPart.CFrame,1)

wait(5)

createDialogueEvent:FireAllClients(“Oh yeah! My favorite anime is on, My Hero Academia!”)
game.Workspace.Screen.Deku.Transparency = 0

wait(5)

getRandomCharacter()
setDialogueImageEvent:FireAllClients(randomCharacter, Color3.new(0.666667, 0, 1))
createDialogueEvent:FireAllClients(“This is a pretty good anime.”)

wait(5)

game.Workspace.Screen.Deku.Transparency = 1
game.Workspace.Screen.RobloxNews.Transparency = 0

setDialogueImageEvent:FireAllClients(game.Workspace[“News Reporter”], Color3.new(1, 0.666667, 0))
createDialogueEvent:FireAllClients("")

wait(0.5)

createDialogueEvent:FireAllClients(“Good evening ladies and gentlemen, I am back with a very serious yet interesting story.”)

wait(7)

createDialogueEvent:FireAllClients(“We have investigated that a mysterious creature is roaming around your city.”)

wait(5)

game.Workspace.Screen.RobloxNews.Transparency = 1
game.Workspace.Screen.RobloxNews2.Transparency = 0
createDialogueEvent:FireAllClients(“Here is a evident photo of the creature before the owner was killed.”)

wait(5)

createDialogueEvent:FireAllClients(“What we know so far about it is that it is very strong, and enjoys going near innocent children.”)

wait(5)

game.Workspace.Screen.RobloxNews2.Transparency = 1
game.Workspace.Screen.RobloxNews3.Transparency = 0

createDialogueEvent:FireAllClients(“We advise that you stay at home, until we have captured the creature.”)

wait(5)

createDialogueEvent:FireAllClients(“Thats all the news for today, thank you for joining me tonight for this important message, and we will see you again soon.”)

wait(7.5)

cameraToPlayerEvent:FireAllClients()

setDialogueImageEvent:FireAllClients(game.Workspace.Miles, Color3.new(0, 0, 1))

createDialogueEvent:FireAllClients("")

wait(0.5)

createDialogueEvent:FireAllClients(“Thats weird… This city should be danger-proofed.”)

wait(5)

createDialogueEvent:FireAllClients(“I guess it was strong enough to overcome it…”)

wait(5)
stopSoundsEvent:FireAllClients()
playSoundEvent:FireAllClients(power_down,0)
game.Lighting.OutdoorAmbient = Color3.new(0, 0, 0)
game.Lighting.Brightness = 0
game.Lighting.TimeOfDay = “01:00:00”
game.Lighting.FogColor = Color3.new(0, 0, 0)
game.Lighting.FogEnd = 20
game.Lighting.FogStart = 10

wait(1.5)
stopSoundsEvent:FireAllClients()

createDialogueEvent:FireAllClients(“Oh, I guess we had a power outage, I am going to go fix it. Be right back.”)

wait(5)

game.Workspace.Miles:Destroy()

local monster = game.ReplicatedStorage.Monster:Clone()
monster.Parent = game.Workspace

setDialogueImageEvent:FireAllClients(game.Workspace.Server, Color3.new(0.690196, 0.690196, 0.690196))

createDialogueEvent:FireAllClients("")

wait(0.5)

createDialogueEvent:FireAllClients(“Survive The Monster.”)

wait(2)

hideDialogueEvent:FireAllClients()

TimerEvent:FireAllClients(30)
wait(30)

monster:Destory()

npc2:clone()

I didn’t see any errors expect for the destroying and cloning of the character, but I ignored it because it didn’t really affect the code.

You should fix problem for a better experience for players and enjoyable people dont like game with bugs :slight_smile:

1 Like

I don’t really see an error related to the timer with the main script… Can you show us the TimerEvent remote script?

1 Like

Sure.

local player = game.Players.LocalPlayer
local TimerEvent = game.ReplicatedStorage.TimerEvent
local ScreenGui = player.PlayerGui.ScreenGui

local stopTimer = false

TimerEvent.OnClientEvent:Connect(function(timer)
	ScreenGui.TimerFrame.TextLabel.Text = timer
	ScreenGui.TimerFrame.TextLabel.Visible = true
	wait(1)
	repeat
		timer = timer - 1
		ScreenGui.TimerFrame.TextLabel.Text = timer
		wait(1)
	until
	timer <= 0 or stopTimer == true
	ScreenGui.TimerFrame.TextLabel.Visible = false	
	stopTimer = false
end)

I don’t really understand why I am experiencing this problem. I just don’t.

Maybe studio updates changes codes making scripts bug and making game broken

I think I might see a problem, although I’m a bit unexperienced.
I’m pretty sure - from what I can recall - that the line right under the “until” needs to be on the same line as the “until.”
The reason is that Studio thinks there is no parameters on when to stop, and the line underneath will not run due to an infinite loop (repeat until ___)
Since I’m inexperienced, this might not work, but I really hope it helps.

Here is the updated TimerEvent script:

local player = game.Players.LocalPlayer
local TimerEvent = game.ReplicatedStorage.TimerEvent
local ScreenGui = player.PlayerGui.ScreenGui

local stopTimer = false

TimerEvent.OnClientEvent:Connect(function(timer)
ScreenGui.TimerFrame.TextLabel.Text = timer
ScreenGui.TimerFrame.TextLabel.Visible = true
wait(1)
repeat
timer = timer - 1
ScreenGui.TimerFrame.TextLabel.Text = timer
wait(1)
until
timer <= 0 or stopTimer == true
ScreenGui.TimerFrame.TextLabel.Visible = false
stopTimer = false

end)

I tried making the lines below “repeat” match up with “repeat”. Unfortunately, this didn’t fix the problem.

If you still haven’t found a solution, I suggest recoding–instead of firing to all clients for the text, add a string object in a client location, change the value on the server and have the local script within player’s GUI detect the getpropertychanged of (“Value”) and then set the text == value