Hey guys,
So I was trying to change the player’s character when they touch a part. It works good for some seconds the player dies for some reason and on spawn they go back to there normal character. I don’t know how to fix it. The character I want them to change too is also rigged, if I go in the animation editor and hover over it I see the blue box around it. I can even animate it, so I think riggin shouldn’t be the problem here.
Script inside the part to be touched:
script.Parent.Touched:Connect(function(hit)
if game.Players:GetPlayerFromCharacter(hit.Parent) then
script.Parent.PlayerWeld.Part1 = hit.Parent.HumanoidRootPart
game.Players:GetPlayerFromCharacter(hit.Parent).Character = script.Parent.Parent
repeat wait()
workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
until workspace.CurrentCamera.CameraType == Enum.CameraType.Scriptable
workspace.CurrentCamera.CameraSubject = script.Parent.Parent
repeat wait()
workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
until workspace.CurrentCamera.CameraType == Enum.CameraType.Custom
end
end)