I want to make a player go first person then out of first person smoothly, where when it switches to first person the player is just in first person and it doesn’t zoom in.
i want to make a cut scene but the player is in first person and they switch from first to third. but when switching back to first it earthier doesn’t work or it slowly zooms to first person.
the game is always will be in first person.
here is the script:
-- __ -- __ -- Important -- __ -- __ --
local humanoid = script.Parent:FindFirstChild("Humanoid")
local Player = game:GetService("Players").LocalPlayer
local Rep = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local Stop = false
-- __ -- __ -- Animation Sets -- __ -- __ --
local LeverOn = script:WaitForChild("LeverOn")
local LeverOnAnimation = humanoid.Animator:LoadAnimation(LeverOn)
Rep.AnimationTriggers.LeverOn.OnClientEvent:Connect(function(Object)
humanoid.WalkSpeed = 0
print(humanoid.WalkSpeed)
humanoid.Parent.HumanoidRootPart.CFrame = CFrame.new(Object.Value.Position)
humanoid.Parent.HumanoidRootPart.CFrame *= CFrame.Angles(math.rad(Object.Value.Orientation.X), math.rad(Object.Value.Orientation.Y), math.rad(Object.Value.Orientation.Z))
humanoid.Parent.HumanoidRootPart.Anchored = true
delay(1.917, function()
Stop = true
end)
LeverOnAnimation:Play()
workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
local function onLeverPullAnimation()
local R = RunService:BindToRenderStep("CameraUpdate", Enum.RenderPriority.Camera.Value + 3, function()
workspace.CurrentCamera.CFrame = humanoid.Parent.Head.CFrame
if Stop == true then
humanoid.Parent.HumanoidRootPart.Anchored = false
humanoid.WalkSpeed = 16
Stop = false
workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
RunService:UnbindFromRenderStep("CameraUpdate")
end
end)
end
onLeverPullAnimation()
end)
local LeverOff = script:WaitForChild("LeverOff")
local LeverOffAnimation = humanoid.Animator:LoadAnimation(LeverOff)
Rep.AnimationTriggers.LeverOff.OnClientEvent:Connect(function(Object)
humanoid.WalkSpeed = 0
print(humanoid.WalkSpeed)
humanoid.Parent.HumanoidRootPart.CFrame = CFrame.new(Object.Value.Position)
humanoid.Parent.HumanoidRootPart.CFrame *= CFrame.Angles(math.rad(Object.Value.Orientation.X), math.rad(Object.Value.Orientation.Y), math.rad(Object.Value.Orientation.Z))
humanoid.Parent.HumanoidRootPart.Anchored = true
delay(1.917, function()
Stop = true
end)
LeverOffAnimation:Play()
workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
local function onLeverPullAnimation()
local R = RunService:BindToRenderStep("CameraUpdate", Enum.RenderPriority.Camera.Value + 3, function()
workspace.CurrentCamera.CFrame = humanoid.Parent.Head.CFrame
if Stop == true then
humanoid.Parent.HumanoidRootPart.Anchored = false
humanoid.WalkSpeed = 16
Stop = false
workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
RunService:UnbindFromRenderStep("CameraUpdate")
end
end)
end
onLeverPullAnimation()
end)