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)