Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

CustomChar dont respawning, how to fix it?

Asked by 2 years ago

im making some custom characters like "monsters", but when spawn as a "monster" and die i just dont respawn, im doing the morph wrong? how to i can make it respawn?

local W = game:GetService("Workspace")
local SS = game:GetService("ServerStorage")
local RS = game:GetService("ReplicatedStorage")
local SP = game:GetService("StarterPlayer")

game.Players.PlayerAdded:Connect(function(plr)

    plr.CharacterAppearanceLoaded:Connect(function(char)

        local stats = plr:FindFirstChild("Stats")
        local race = stats:WaitForChild("Race")

        local hollow = RS:FindFirstChild("Hollow")

        if race.Value == "hollow" then
            local newChar = hollow:Clone()
            newChar.Name = plr.Name
            newChar.Parent = W
            newChar.PrimaryPart = newChar.HumanoidRootPart
            newChar.PrimaryPart.CFrame = plr.Character.PrimaryPart.CFrame
            plr.Character = newChar
            game.ReplicatedStorage:WaitForChild("CameraFix"):FireClient(plr)
        end
    end)
end)

Answer this question