Custom character script won't work, what did I do wrong?
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:
01 | local chartemplate = game.ReplicatedStorage.CharacterTemplate |
03 | game.Players.PlayerAdded:connect( function (Player) |
04 | Player.CharacterAdded:connect( function (Char) |
08 | function AddChar(Player, Char) |
09 | if not Player.Parent then return end |
10 | local NewChar = chartemplate |
11 | NewChar.Name = Player.Name |
12 | if Player.Character then |
13 | Player.Character:Destroy() |
15 | Player.Character = NewChar |
16 | NewChar.Parent = game.Workspace |