So, I'm working on a game and I made a custom character, but it won't work! The problem is that I get the error "The Parent property of Player1 is locked, current parent: NULL, new parent Workspace" after I see a message that says "Creating Player". What did I do wrong? Here is the script:
local chartemplate = game.ReplicatedStorage.CharacterTemplate
game.Players.PlayerAdded:connect(function(Player)
Player.CharacterAdded:connect(function(Char)
AddChar(Player, Char)
end)
end)
function AddChar(Player, Char)
if not Player.Parent then return end
local NewChar = chartemplate
NewChar.Name = Player.Name
if Player.Character then
Player.Character:Destroy()
end
Player.Character = NewChar
NewChar.Parent = game.Workspace
end
