I am currently working on a character switch script it works fine up until I have to change the name, it says I lack the compabilities to change its name, I tried different ways of changing the name same error, why is this? what me
this is the code I have
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RemoteEvent = ReplicatedStorage:WaitForChild("SwitchCharacters")
RemoteEvent.OnServerEvent:Connect(function(Player,Mod)
local CharMod = require(Mod)
local CharModel = CharMod.CharModel:Clone()
local PlrCharacter = Player.Character
if PlrCharacter then
CharModel.HumanoidRootPart.Anchored = false
CharModel:SetPrimaryPartCFrame(PlrCharacter.PrimaryPart.CFrame)
Player.Character = CharModel
CharModel.Parent = workspace
CharModel.Name = Player.Name -- Doesn't Work
end
end)