So, I have this local script for an intro in my game.
local player = game.Players.LocalPlayer local camera = game.Workspace.CurrentCamera print('testBefore') camera.CameraType = Enum.CameraType.Scriptable camera:GetPropertyChangedSignal("CameraType"):Wait() camera.CameraType = Enum.CameraType.Scriptable print('testAfter') local tweenservice = game:GetService("TweenService") local folder = game.Workspace.SpawnCam camera.CameraType = Enum.CameraType.Scriptable function tween(part1, part2) camera.CFrame = part1.CFrame local Tween = tweenservice:Create(camera, TweenInfo.new(10, Enum.EasingStyle.Linear), { CFrame = part2.CFrame }) Tween:Play() Tween.Completed:Connect(function() print('tween completed') end) end cln = game.ReplicatedStorage.ScreenGui cln = cln:Clone() cln.Parent = player.PlayerGui player.CharacterAdded:Wait() player.PlayerGui:WaitForChild("Blackout") while true do tweenservice:Create(player.PlayerGui.Blackout.Frame, TweenInfo.new(1, Enum.EasingStyle.Linear), { BackgroundTransparency = 1 }):Play() tween(folder["1"], folder["2"]) wait(9) tweenservice:Create(player.PlayerGui.Blackout.Frame, TweenInfo.new(1, Enum.EasingStyle.Linear), { BackgroundTransparency = 0 }):Play() wait(1) tween(folder["3"], folder["4"]) tweenservice:Create(player.PlayerGui.Blackout.Frame, TweenInfo.new(1, Enum.EasingStyle.Linear), { BackgroundTransparency = 1 }):Play() wait(9) tweenservice:Create(player.PlayerGui.Blackout.Frame, TweenInfo.new(1, Enum.EasingStyle.Linear), { BackgroundTransparency = 0 }):Play() wait(1) tween(folder["5"], folder["6"]) tweenservice:Create(player.PlayerGui.Blackout.Frame, TweenInfo.new(1, Enum.EasingStyle.Linear), { BackgroundTransparency = 1 }):Play() wait(9) tweenservice:Create(player.PlayerGui.Blackout.Frame, TweenInfo.new(1, Enum.EasingStyle.Linear), { BackgroundTransparency = 0 }):Play() wait(1) end
My previous error had to do with the cameratype not changing, but now I have a different error: The camera is stuck in mid air.
The CameraType automatically gets set after a Player is added, enough time for any LocalScript to set the CameraType. Your best bet is to add a check before hand, like so:
local camera = workspace.CurrentCamera camera.CameraType = Enum.CameraType.Scriptable camera:GetPropertyChangedSignal("CameraType"):Wait() camera.CameraType = Enum.CameraType.Scriptable -- rest of code here
You can't change server-sided stuff through a local script, Try using a remote event for that