Hello.
So I tried adding a custom character in my game through script.
But when i tried to change the character’s name to the players name it printed an error:
Also here is the script:
> local Players = game:GetService("Players");
> local char = game.ReplicatedStorage.Characters.Andrew
> Players.PlayerAdded:Connect(function(player)
> while true do
> player.CharacterAdded:Wait()
> local character = char:Clone()
> character.HumanoidRootPart.CFrame = player.Character.HumanoidRootPart.CFrame
> player.Character:Destroy()
> player.Character = character
> character.Parent = workspace
> character.Name = player.Name
> end
> end)
Can anyone help me? What do i do?
Also have a nice day