Next Sublevel Gui bugging out

So, I have been working on a PM 6:06 fan-game, but there is one error.
It has nothing to do with any other game,
the second time the script activates, it will not show the new sublevel’s name.
!THERE ARE NO ERRORS IN THE OUTPUT WINDOW!
Here is my code:

game.ReplicatedStorage.ChangeSublevel.OnClientEvent:Connect(function(Sublevel, Music)
	print("New Sublevel")
	script.Parent.Frame.Transparency = 1
	script.Parent.Frame.Visible = true
	script.Parent.Frame.CurrentSublevel.Text = workspace.CurrentSublevel.Value
	workspace.CurrentSublevel.Value = Sublevel
	script.Parent.Frame.NextSublevel.Text = Sublevel
	script.Parent.Frame.NextSublevel.Position = UDim2.new(0.732, 0, -0.5, 0)
	script.Parent.Frame.CurrentSublevel.Position = UDim2.new(0.732, 0, 0.916, 0)
	script.Parent.Frame.CurrentSublevel.Transparency = 1
	EnterTween = game:GetService("TweenService"):Create(script.Parent.Frame, TweenInfo.new(1, Enum.EasingStyle.Circular, Enum.EasingDirection.InOut, 0, false, 0), {["BackgroundTransparency"] = 0})
	FadeTween = game:GetService("TweenService"):Create(script.Parent.Frame.CurrentSublevel, TweenInfo.new(3, Enum.EasingStyle.Circular, Enum.EasingDirection.InOut, 0, false, 0), {["TextTransparency"] = 0})
	EnterTween:Play()
	FadeTween:Play()
	wait(FadeTween.TweenInfo.Time)
	if Music:IsA("Sound") then
		for i, Song in pairs(game.ReplicatedStorage.Music:GetChildren()) do
			if Song:IsA("Sound") then
				Song:Stop()
			end
		end
		Music:Play()
	end
	wait(1)
	FadeTween = game:GetService("TweenService"):Create(script.Parent.Frame.CurrentSublevel, TweenInfo.new(3, Enum.EasingStyle.Circular, Enum.EasingDirection.InOut, 0, false, 0), {["TextTransparency"] = 1})
	ReplaceTween = game:GetService("TweenService"):Create(script.Parent.Frame.NextSublevel, TweenInfo.new(3, Enum.EasingStyle.Circular, Enum.EasingDirection.InOut, 0, false, 0), {["Position"] = script.Parent.Frame.CurrentSublevel.Position}) --This is the line where the error occurs. (it may be a different line)
	FadeTween:Play()
	ReplaceTween:Play()
	wait(ReplaceTween.TweenInfo.Time)
	wait(1)
	ExitTween = game:GetService("TweenService"):Create(script.Parent.Frame, TweenInfo.new(1, Enum.EasingStyle.Circular, Enum.EasingDirection.InOut, 0, false, 0), {["BackgroundTransparency"] = 1})
	FadeTween = game:GetService("TweenService"):Create(script.Parent.Frame.NextSublevel, TweenInfo.new(1, Enum.EasingStyle.Circular, Enum.EasingDirection.InOut, 0, false, 0), {["TextTransparency"] = 1})
	ExitTween:Play()
	FadeTween:Play()
	wait(ExitTween.TweenInfo.Time)
	script.Parent.Frame.Visible = false
end)

no, that is the current sublevel text. That gets it’s transparency removed afterwards, because it needs to fade in.

1 Like

Hi,

It would appear you are setting the “NextSublevel” text transparency to 1, but then never making it visible again.

FadeTween = game:GetService("TweenService"):Create(script.Parent.Frame.NextSublevel, TweenInfo.new(1, Enum.EasingStyle.Circular, Enum.EasingDirection.InOut, 0, false, 0), {["TextTransparency"] = 1})

Hope this solves your issue.

1 Like

Ohhh. Thanks! :grinning: I will test it.
Update: It works! :smile: I tried it, and it turns out you were correct!
Here is the new script:

game.ReplicatedStorage.ChangeSublevel.OnClientEvent:Connect(function(Sublevel, Music)
	print("New Sublevel")
	script.Parent.Frame.Transparency = 1
	script.Parent.Frame.Visible = true
	script.Parent.Frame.CurrentSublevel.Text = workspace.CurrentSublevel.Value
	workspace.CurrentSublevel.Value = Sublevel
	script.Parent.Frame.NextSublevel.Text = Sublevel
	script.Parent.Frame.NextSublevel.Position = UDim2.new(0.732, 0, -0.5, 0)
	script.Parent.Frame.CurrentSublevel.Position = UDim2.new(0.732, 0, 0.916, 0)
	script.Parent.Frame.CurrentSublevel.Transparency = 1
	script.Parent.Frame.NextSublevel.TextTransparency = 1
	EnterTween = game:GetService("TweenService"):Create(script.Parent.Frame, TweenInfo.new(1, Enum.EasingStyle.Circular, Enum.EasingDirection.InOut, 0, false, 0), {["BackgroundTransparency"] = 0})
	FadeTween = game:GetService("TweenService"):Create(script.Parent.Frame.CurrentSublevel, TweenInfo.new(3, Enum.EasingStyle.Circular, Enum.EasingDirection.InOut, 0, false, 0), {["TextTransparency"] = 0})
	EnterTween:Play()
	FadeTween:Play()
	wait(FadeTween.TweenInfo.Time)
	if Music:IsA("Sound") then
		for i, Song in pairs(game.ReplicatedStorage.Music:GetChildren()) do
			if Song:IsA("Sound") then
				Song:Stop()
			end
		end
		Music:Play()
	end
	wait(1)
	script.Parent.Frame.NextSublevel.TextTransparency = 0
	FadeTween = game:GetService("TweenService"):Create(script.Parent.Frame.CurrentSublevel, TweenInfo.new(3, Enum.EasingStyle.Circular, Enum.EasingDirection.InOut, 0, false, 0), {["TextTransparency"] = 1})
	ReplaceTween = game:GetService("TweenService"):Create(script.Parent.Frame.NextSublevel, TweenInfo.new(3, Enum.EasingStyle.Circular, Enum.EasingDirection.InOut, 0, false, 0), {["Position"] = script.Parent.Frame.CurrentSublevel.Position})
	FadeTween:Play()
	ReplaceTween:Play()
	wait(ReplaceTween.TweenInfo.Time)
	wait(1)
	ExitTween = game:GetService("TweenService"):Create(script.Parent.Frame, TweenInfo.new(1, Enum.EasingStyle.Circular, Enum.EasingDirection.InOut, 0, false, 0), {["BackgroundTransparency"] = 1})
	FadeTween = game:GetService("TweenService"):Create(script.Parent.Frame.NextSublevel, TweenInfo.new(1, Enum.EasingStyle.Circular, Enum.EasingDirection.InOut, 0, false, 0), {["TextTransparency"] = 1})
	ExitTween:Play()
	FadeTween:Play()
	wait(ExitTween.TweenInfo.Time)
	script.Parent.Frame.Visible = false
end)
1 Like

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