Hi! Im currently trying to make a start screen for my game and it seems like the script starts until the player is actually loaded… I might be incorrect but that seems like how it is. Ive looked on scriptinghelpers and found nothing.
local TS = game:GetService('TweenService')
local part = game.Workspace:WaitForChild("Camera1")
local Camera = workspace.CurrentCamera
repeat wait() until game.Players.LocalPlayer.Character
local goal = {Position = Vector3.new(216.047, 10.922, 18.328)}
local tween = TweenInfo.new(40, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, -1, true, 0)
local tweened = TS:Create(part, tween, goal)
tweened:Play()
Camera.CameraType = Enum.CameraType.Scriptable
Camera.CFrame = part.CFrame
Camera.CameraSubject = part
game.Players.LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, false)
I think you want to wait until everything is loaded, right? You can achieve this by using ContentProvider:PreloadAsync. Just loop this trough every object in your game in a pcall.