I'm morphing into a model using a tool and a remote event. The morphing works, but I still have some issues I would like some help with. First, the red outline that appears when you die shows up when I morph. Second, the camera stays fixed where my old character was before morphing, and setting the CameraSubject to the new character doesn't work. Third, the morph works for only a few seconds before disabling, un-morphing my character, and putting me in a spawn location. Could someone help? Here is my code:
(Local Script in the tool)
local repstore = game:GetService("ReplicatedStorage")
local rev = repstore:WaitForChild("CharMorph")
local player = game.Players.LocalPlayer
local tool = script.Parent
tool.Equipped:Connect(function()
rev:FireServer(player)
end)
(Regular Script in ServerScriptService)
local repstore = game:GetService("ReplicatedStorage")
local rev = repstore:WaitForChild("CharMorph")
local tool = game.StarterPack:FindFirstChildOfClass("Tool")
local newchar = tool.NoobTank
local camera = game.Workspace.Camera
rev.OnServerEvent:Connect(function(player)
local oldchar = player
newchar:SetPrimaryPartCFrame(oldchar.Character.PrimaryPart.CFrame)
newchar.Parent = workspace
oldchar.Character = newchar
camera.CameraSubject = newchar.PrimaryPart
end)
The model I'm morphing into is in the tool along with the Local Script, and the tool is in StarterPack.The model is made of a Humanoid, a HumanoidRootPart, and meshes I made in Blender if that helps. I don't know what to do, I'm stuck.
