Ill keep this short and simple cause i have no idea what could be causing this.
Why does 11 print but 12 never ever prints? setting the wait to 0 makes 12 print
print(11)
task.wait(1)
print(12) --Any code under here NEVER runs
print(11)
task.wait(0)
print(12) --Any code under here will run
Ofcourse this is not my full code, but i doubt it has anything with the rest of the code to do since everything up to 11 prints
local TweenService = game:GetService("TweenService")
script.TravelTo.Event:Connect(function(Character : Model, Destination : Vector3, Name : string)
local CurrentCamera = game.Workspace.CurrentCamera
print(1)
local DefaultCam = CurrentCamera.CameraType
print(2)
CurrentCamera.CameraType = Enum.CameraType.Scriptable
print(3)
TweenService:Create(CurrentCamera, TweenInfo.new(2, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {["CFrame"] = CFrame.lookAt(Character.Head.Position + Vector3.new(0, 50, 0), Character.Head.Position)}):Play()
print(4)
task.wait(2)
print(5)
TweenService:Create(CurrentCamera, TweenInfo.new(4, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {["CFrame"] = CFrame.lookAt(Vector3.new(Character.Head.Position) + Vector3.new(0, 4000, 0), Vector3.new(Character.Head.Position))}):Play()
print(6)
TweenService:Create(game.Lighting, TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {["ExposureCompensation"] = 5}):Play()
print(7)
task.wait(1)
print(8)
Character = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
print(9)
CurrentCamera.CFrame = CFrame.lookAt(Character.Head.Position + Vector3.new(10, 4000, 10), Character.Head.Position)
print(10)
TweenService:Create(CurrentCamera, TweenInfo.new(4, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {["CFrame"] = CFrame.lookAt(Character.Head.Position + Vector3.new(10, 10, 10), Character.Head.Position)}):Play()
print(11)
task.wait(1)
print(12)
TweenService:Create(game.Lighting, TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {["ExposureCompensation"] = 0}):Play()
end)
I also cant set the wait after “print(7)” to more than 1 cause then the same issue occurs