I have this script for an undertale intro, and what’s suppost to happen is after the fade in it would enable some scripts, but I think those scripts aren’t being enabled and I’m getting an error I can only see outside of studio that doesn’t give me any details onto why the error is happening.
Summary
function skipIntro()
if IntroSkipped then return end
IntroSkipped = true
BGM:Stop()
BGM.TimePosition = 0
BGM.Looped = true
Intro.Hint.Visible = false
Intro.Text.Visible = false
Intro.TextMiddle.Visible = false
Intro.FadeSound:Play()
local tween = TweenService:Create(Player.PlayerGui.Effects.Fade, TweenInfo.new(5.19, Enum.EasingStyle.Sine, Enum.EasingDirection.In), {BackgroundTransparency = 0})
tween:Play()
tween.Completed:Connect(function()
Intro.BG.Visible = false
Intro.TopBar.Visible = false
Intro.BottomBar.Visible = false
Intro.Display.ImageTransparency = 1
Intro.Display2.ImageTransparency = 1
Player.PlayerGui.Players.Enabled = true
Player.PlayerGui.Inventory.Enabled = true
Player.PlayerGui.Room.Enabled = true
Player.PlayerScripts.CharacterHandler.Enabled = true
Player.PlayerGui.Inventory.InventoryHandeler.Enabled = true
– this is where error starts
Player.PlayerGui.Room.RoomHandeler.Enabled = true
Player.PlayerGui.Effects.Fade.BackgroundColor3 = Color3.new(0, 0, 0)
local tween2 = TweenService:Create(Player.PlayerGui.Effects.Fade, TweenInfo.new(0.15, Enum.EasingStyle.Sine, Enum.EasingDirection.In), {BackgroundTransparency = 1})
tween2:Play()
end)
end
if game:IsLoaded() and not IntroSkipped then
Intro.Text.Text = “PRELOADING INTRO, PLEASE WAIT.”
ContentProvider:PreloadAsync(Intro:GetChildren())
BGM:Play()
IntroTypewrite("Long ago, two races ruled over Earth: HUMANS and MONSTERS.")
if IntroSkipped then return end
TweenService:Create(Intro.Display, TweenInfo.new(0.8, Enum.EasingStyle.Sine, Enum.EasingDirection.In), {ImageTransparency = 1}):Play()
task.wait(0.8)
if IntroSkipped then return end
Intro.Display.ImageRectOffset = Vector2.new(5, 246)
TweenService:Create(Intro.Display, TweenInfo.new(0.8, Enum.EasingStyle.Sine, Enum.EasingDirection.In), {ImageTransparency = 0}):Play()
IntroTypewrite("One day, war broke out between the two races.")
if IntroSkipped then return end
TweenService:Create(Intro.Display, TweenInfo.new(0.8, Enum.EasingStyle.Sine, Enum.EasingDirection.In), {ImageTransparency = 1}):Play()
task.wait(0.8)
if IntroSkipped then return end
Intro.Display.Image = "rbxassetid://126843759753750"
Intro.Display.ImageRectOffset = Vector2.new(5, 0)
ContentProvider:PreloadAsync(Intro:GetChildren())
TweenService:Create(Intro.Display, TweenInfo.new(0.8, Enum.EasingStyle.Sine, Enum.EasingDirection.In), {ImageTransparency = 0}):Play()
IntroTypewrite("After a long battle, the humans were victorious.")
if IntroSkipped then return end
TweenService:Create(Intro.Display, TweenInfo.new(0.8, Enum.EasingStyle.Sine, Enum.EasingDirection.In), {ImageTransparency = 1}):Play()
task.wait(0.8)
if IntroSkipped then return end
Intro.Display.ImageRectOffset = Vector2.new(5, 246)
TweenService:Create(Intro.Display, TweenInfo.new(0.8, Enum.EasingStyle.Sine, Enum.EasingDirection.In), {ImageTransparency = 0}):Play()
IntroTypewrite("They sealed the monsters underground with a magic spell.")
if IntroSkipped then return end
TweenService:Create(Intro.Display, TweenInfo.new(0.8, Enum.EasingStyle.Sine, Enum.EasingDirection.In), {ImageTransparency = 1}):Play()
task.wait(0.8)
if IntroSkipped then return end
IntroTypewrite("Many years later...")
if IntroSkipped then return end
IntroTypewrite(" ")
task.wait(0.5)
if IntroSkipped then return end
Intro.Display.Image = "rbxassetid://80290888465740"
Intro.Display.ImageRectOffset = Vector2.new(5, 0)
ContentProvider:PreloadAsync(Intro:GetChildren())
TweenService:Create(Intro.Display, TweenInfo.new(0.8, Enum.EasingStyle.Sine, Enum.EasingDirection.In), {ImageTransparency = 0}):Play()
Intro.Text.TextXAlignment = Enum.TextXAlignment.Center
IntroTypewriteSpecial("MT. EBOTT")
if IntroSkipped then return end
IntroTypewrite2("201X")
task.wait(2)
if IntroSkipped then return end
TweenService:Create(Intro.Display, TweenInfo.new(0.8, Enum.EasingStyle.Sine, Enum.EasingDirection.In), {ImageTransparency = 1}):Play()
task.wait(0.8)
if IntroSkipped then return end
Intro.Text.TextXAlignment = Enum.TextXAlignment.Left
Intro.Display.ImageRectOffset = Vector2.new(5, 246)
TweenService:Create(Intro.Display, TweenInfo.new(0.8, Enum.EasingStyle.Sine, Enum.EasingDirection.In), {ImageTransparency = 0}):Play()
Intro.TextMiddle.Text = ""
IntroTypewrite("Legends say that those who climb the mountain never return.")
if IntroSkipped then return end
TweenService:Create(Intro.Display, TweenInfo.new(0.8, Enum.EasingStyle.Sine, Enum.EasingDirection.In), {ImageTransparency = 1}):Play()
Intro.Text.Text = ""
task.wait(0.8)
if IntroSkipped then return end
Intro.Display.Image = "rbxassetid://127934833373368"
Intro.Display.ImageRectOffset = Vector2.new(5, 0)
ContentProvider:PreloadAsync(Intro:GetChildren())
TweenService:Create(Intro.Display, TweenInfo.new(0.8, Enum.EasingStyle.Sine, Enum.EasingDirection.In), {ImageTransparency = 0}):Play()
task.wait(4)
if IntroSkipped then return end
TweenService:Create(Intro.Display, TweenInfo.new(0.8, Enum.EasingStyle.Sine, Enum.EasingDirection.In), {ImageTransparency = 1}):Play()
task.wait(0.8)
if IntroSkipped then return end
Intro.Display.ImageRectOffset = Vector2.new(5, 246)
TweenService:Create(Intro.Display, TweenInfo.new(0.8, Enum.EasingStyle.Sine, Enum.EasingDirection.In), {ImageTransparency = 0}):Play()
task.wait(4)
if IntroSkipped then return end
TweenService:Create(Intro.Display, TweenInfo.new(0.8, Enum.EasingStyle.Sine, Enum.EasingDirection.In), {ImageTransparency = 1}):Play()
task.wait(0.8)
if IntroSkipped then return end
Intro.Display.Image = "rbxassetid://96491052324468"
Intro.Display.ImageRectOffset = Vector2.new(5, 0)
ContentProvider:PreloadAsync(Intro:GetChildren())
TweenService:Create(Intro.Display, TweenInfo.new(0.8, Enum.EasingStyle.Sine, Enum.EasingDirection.In), {ImageTransparency = 0}):Play()
task.wait(4)
if IntroSkipped then return end
TweenService:Create(Intro.Display, TweenInfo.new(0.8, Enum.EasingStyle.Sine, Enum.EasingDirection.In), {ImageTransparency = 1}):Play()
task.wait(0.8)
if IntroSkipped then return end
TweenService:Create(Intro.Display2, TweenInfo.new(0.8, Enum.EasingStyle.Sine, Enum.EasingDirection.In), {ImageTransparency = 0}):Play()
task.wait(4)
if IntroSkipped then return end
TweenService:Create(Intro.Display2, TweenInfo.new(10, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut), {Position = UDim2.new(0.277, 0, 0.059, 0)}):Play()
task.wait(10)
if IntroSkipped then return end
task.wait(7.5)
if IntroSkipped then return end
game:GetService("TweenService"):Create(Intro:WaitForChild("Display2"),TweenInfo.new(0.8,Enum.EasingStyle.Sine,Enum.EasingDirection.In),{ImageTransparency = 1}):Play()
game:GetService("TweenService"):Create(Intro:WaitForChild("Display"),TweenInfo.new(0.8,Enum.EasingStyle.Sine,Enum.EasingDirection.In),{ImageTransparency = 1}):Play()
game:GetService("TweenService"):Create(BGM,TweenInfo.new(0.8,Enum.EasingStyle.Sine,Enum.EasingDirection.In),{Volume = 0}):Play()
Intro.Text.Visible = false
Intro.TextMiddle.Visible = false
task.wait(1)
Intro.Display.ImageTransparency = 0
Intro.TopBar.Visible = false
Intro.BottomBar.Visible = false
Intro.PopSound:Play()
BGM:Stop()
BGM.TimePosition = 0
BGM.Volume = 0.5
Intro.Display.Image = "rbxassetid://136018855151187"
Intro.Display.ImageRectOffset = Vector2.new(5,0)
Intro.Display.ImageRectSize = Vector2.new(320,240)
game:GetService("ContentProvider"):PreloadAsync(Intro:GetChildren())
Intro.Display.ImageTransparency = 0
Intro.Hint.Visible = true
end