im trying to make a camera that attaches to the character.Head that smoothly goes down, When i die it works but when i die again it goes to the same position it was before. Could someone help me with this?
code:
local tweenservice = game:GetService("TweenService")
local currentcamera = workspace.CurrentCamera
local sound = script.Sound
local players = game:GetService("Players")
local Player = players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
game.ReplicatedStorage.Events2.Died.OnClientEvent:Connect(function()
currentcamera.CameraType = Enum.CameraType.Scriptable
local ti = TweenInfo.new(7,Enum.EasingStyle.Quad,Enum.EasingDirection.In,0)
local goal = {CFrame = Character.Head.CFrame}
local animation = tweenservice:Create(currentcamera,ti,goal)
animation:Play()
local deathsound = sound:Clone()
deathsound.TimePosition = 1.5
deathsound.SoundId = "rbxassetid://148590801"
deathsound.Parent = script
deathsound:Play()
wait(5)
currentcamera.CameraType = Enum.CameraType.Custom
end)