Setting Character isn't working

I am trying to make a startercharacter system where there is a different character for each team. I am going to add to this script in the future.

But I need help getting this to work

local char = game.ReplicatedStorage.StarterCharacter:Clone()
char.Parent = game.Workspace

script.Parent.Parent.Character = char
workspace.CurrentCamera.CameraSubject = script.Parent.Parent.Character.Head

I don’t really know what I am doing in this sense but if someone could just help me get this to work, I would appreciate it.

Ok, after a bit of problem-solving it worked when I turned CharacterAutoLoads off.