If the Player spawns multiple Times it will work every Time.
But after the Player resets himself, the Player will Spawn but the Camera will not change.
U will see in the Video after i tried to Spawn again after i reset on the Bottom-Right a Error Message 02, this means the Character is not loaded now and this Script is working.
It will work again if the Character is loaded. But when the Character is loaded the Camera will not change.
Video:
robloxapp-20220901-0253450.wmv (3,2 MB)
Camera Script:
local TweenService = game:GetService("TweenService")
local player = game.Players.LocalPlayer
local introCameras = game.Workspace:WaitForChild("IntroCameras")
local tweenInfo = TweenInfo.new (
50,
Enum.EasingStyle.Quad,
Enum.EasingDirection.InOut,
-1,
true,
0
)
local tweenCreate = TweenService:Create(game.Workspace.CurrentCamera, tweenInfo, {CFrame = introCameras.IntroCamera3.CFrame})
game.ReplicatedStorage:WaitForChild("CameraMenuAnimation").Event:Connect(function(trueNilOrFalse)
if trueNilOrFalse == false then
tweenCreate:Cancel()
elseif trueNilOrFalse == true then
if workspace.CurrentCamera.CameraType ~= Enum.CameraType.Scriptable then
workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
end
tweenCreate:Play()
elseif trueNilOrFalse == nil then
if workspace.CurrentCamera.CameraType ~= Enum.CameraType.Scriptable then
workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
end
workspace.CurrentCamera.CFrame = introCameras.IntroCamera2.CFrame
end
end)
game.ReplicatedStorage:WaitForChild("PassengerRemoteEvent").OnClientEvent:Connect(function()
workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
workspace.CurrentCamera.CFrame = CFrame.new(player.Character.HumanoidRootPart.CFrame.LookVector)
end)