'Animate' (local) script not working, when enabled by Server side in a custom Character

Hello, everyone thanks for coming, i have gone into one single issue while setting a player’s character to a r6 default rig model (kinda), ill describe it:

  1. What do you want to achieve? A script that set the player’s character to a custom r6 rig… (The starter character method wont work here);

  2. What is the issue? The animate script (client-sided script) is enabled by server, and its not working for some reason…

  3. What solutions have you tried so far? Almost all i could imagine, i don’t know anymore!

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

local function CustomCharacterRole(p1, p2)
	if p1:IsA("Player") then
		local Rep = game:GetService("ServerStorage"):WaitForChild("Maps"):FindFirstChild(tostring(p2));
		if Rep and Rep:FindFirstChild("ChapterCharacters") then
			p1.Character.Archivable = true;
			local Skin = Rep:WaitForChild("ChapterCharacters"):GetChildren()[math.random(1, #Rep:WaitForChild("ChapterCharacters"):GetChildren())];
			local NewChar = Skin:Clone();
			NewChar.Archivable = true;
			NewChar.Parent = workspace;
			NewChar.Name = p1.Name;
			local Subber = Instance.new("StringValue", NewChar);
			Subber.Name = "CustomName";
			task.spawn(function()
				NewChar:FindFirstChildOfClass("Humanoid").DisplayName = p1.DisplayName;
				NewChar:FindFirstChildOfClass("Humanoid").DisplayDistanceType = Enum.HumanoidDisplayDistanceType.Viewer;
				NewChar:FindFirstChildOfClass("Humanoid").HealthDisplayDistance = 100;
				NewChar:FindFirstChildOfClass("Humanoid").NameDisplayDistance = 100;
			end)
			if not NewChar:FindFirstChild("Health") then
				local Hel = script:WaitForChild("CustomCharacter").Health:Clone();
				Hel.Parent = NewChar;
				Hel.Enabled = true;
			end
			NewChar:FindFirstChildOfClass("Humanoid").Health = 100;
			Subber.Value = tostring(Skin.Name);
			game:GetService("CollectionService"):AddTag(NewChar, "Survivor");
			NewChar.PrimaryPart.Anchored = false;
			for i, v in pairs(NewChar:GetChildren()) do
				if v:IsA("Script") or v:IsA("LocalScript") then
					v.Enabled = true;
				end
			end
			if not NewChar:FindFirstChild("IsCustomChar") then
				local Enemeyh = Instance.new("BoolValue", NewChar);
				Enemeyh.Name = "IsCustomChar";
				Enemeyh.Value = true;
			end
			p1.Character = NewChar;
			task.wait();
			game:GetService("CollectionService"):AddTag(p1.Character, "Survivor");
			task.spawn(function()
				p1.Character:FindFirstChildOfClass("Humanoid").DisplayName = p1.DisplayName;
				p1.Character:FindFirstChildOfClass("Humanoid").DisplayDistanceType = Enum.HumanoidDisplayDistanceType.Viewer;
				p1.Character:FindFirstChildOfClass("Humanoid").HealthDisplayDistance = 100;
				p1.Character:FindFirstChildOfClass("Humanoid").NameDisplayDistance = 100;
			end)
			p1.Character:FindFirstChildOfClass("Humanoid").Health = 100;
			return NewChar;
		end
	end
end

Any help/ideas/suggestions appreciated!

I already solved this project once if u want to take a look Changing Rig mid-game - #7 by 0ffxInventor