I need help to stop making my camera reset when I change models.
Here is the video:
Here are the scripts:
LocalScript:
local uis = game.UserInputService
uis.InputBegan:Connect(function(i,g)
if g then
return
end
if i.KeyCode == Enum.KeyCode.G then
if script.Parent.DamageDealt.Value >= 1 then
script.Parent.HumanoidRootPart.Anchored = true
script.Parent.Humanoid:LoadAnimation(script.Animation):Play()
script.RemoteEvent:FireServer()
wait(3)
game.ReplicatedStorage.CharChange:FireServer(game.ReplicatedStorage.Char.HollowVessel,workspace.CurrentCamera)
else
print("Need "..2000 - script.Parent.DamageDealt.Value.." more damage to UNLEASH.")
end
end
end)
ServerScript:
game.ReplicatedStorage.CharChange.OnServerEvent:Connect(function(player,model,cam)
local char = model:Clone()
local savename = player.Name
local pos = player.Character.HumanoidRootPart.CFrame
char.Name = savename
player.Character:Destroy()
player.Character = char
char.Parent = workspace
char.HumanoidRootPart.CFrame = pos
model.GuIs.GUI:Clone().Parent = player.PlayerGui
workspace.Camera.CFrame = cam.CFrame
end)
Pls help