i was trying to make a cutscene on touch and then a cutscene/animation plays but after that the camera goes back to the player but the player cant move, i tried fixing the script but there is something wrong
here is the script :
local happend = false
local cam = game.Workspace.CurrentCamera
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local rigAnim = game.ReplicatedStorage:WaitForChild("rigAnim")
local playerAnim = game.ReplicatedStorage:WaitForChild("playerAnim")
local rig = game.Workspace:WaitForChild("Rig")
local rigAnim = rig.Humanoid:WaitForChild("Animator"):LoadAnimation(rigAnim)
local playerAnim = char.Humanoid:WaitForChild("Animator"):LoadAnimation(playerAnim)
local cam1 = game.Workspace:WaitForChild("cam1")
local cam2 = game.Workspace:WaitForChild("cam2")
local touchpart = game.Workspace:WaitForChild("touchPart")
local playerCustscenePosition = game.Workspace:WaitForChild("playerCutscenePosition")
touchpart.Touched:Connect(function(hit)
if happend == false and hit.Parent.Name == player.Name then
happend = true
char.Humanoid.WalkSpeed = 0
char.Humanoid.JumpHeight = 0
char.HumanoidRootPart.CFrame = playerCustscenePosition.CFrame
cam.CameraType = Enum.CameraType.Scriptable
cam.CFrame = cam1.CFrame
task.wait(1.5)
rigAnim:Play()
task.wait(4)
cam.CFrame = cam2.CFrame
playerAnim:Play()
playerAnim.Stopped:Wait()
cam.CameraType = Enum.CameraType.Custom
char.Humanoid.Walkspeed = 16
char.Humanoid.JumpHeight = 7.2
end
end)