Sometimes when a player joins my game, some things don't load properly and are left out of the players current camera. I have no idea why, I event tried waiting for the objects in order to position the camera in the certain spots where parts are loaded. Sometimes the camera's position doesn't get changed at all.
Here is my whole script that works all the camera stuff.
---------------------------------------------------------------------------------------------
repeat Wait() until Game.Players.LocalPlayer
repeat Wait() until Workspace.CurrentCamera
game.StarterGui:SetCoreGuiEnabled(0, false)
game.StarterGui:SetCoreGuiEnabled(2, false)
local Intro = script.Parent:WaitForChild("Intro"):Clone()
Intro.Parent = game.Workspace.CurrentCamera
repeat Wait() until Workspace.CurrentCamera.Intro
local cam = Workspace.CurrentCamera
cam.CameraType = "Scriptable"
cam.CoordinateFrame = CFrame.new(-74.77, 7.73, 107.733)
cam.Focus = CFrame.new(-73.888092, 8.4218502, 107.846222, 2, 0, 0, 0, 1, 0, 0, 0, 1)
-------------------------------------------
local IntroGui = script.Parent.IntroGui
local SkipButton = IntroGui.Content.Pages.Skip
local SadSong = IntroGui.SadSong
---------------------------
function OpenMenu()
for i = 0.5,0,-0.01 do
SadSong.Volume = i
wait()
end
wait()
cam:ClearAllChildren()
local a = script.Parent.MenuCameraPosition:Clone()
a.Parent = game.Workspace.CurrentCamera
IntroGui:Remove()
local Menu = script.Parent.Menu ---------
local Holder = Menu.Holder ---------VARIABLES----------
local PianoSound = Menu.PianoSound ---------
Menu.LocalScript.Disabled = false --Run Menu scripts
PianoSound:Play() --Play Music
Holder.Visible = true --Make Menu visible
end
--------------------------
SkipButton.MouseButton1Down:connect(function()
OpenMenu() ---Closes Intro and opens Menu
end)
|