Continued: And when I remove the LoadCharacter() the clone loads as the character but the animations do not work.
local kage = {
Leaf = "Hokage",
Sand = "Kazekage",
Mist = "Mizukage",
Clouds = "Raikage",
Stone = "Tsuchikage"
}
game.ReplicatedStorage.spawn.OnServerEvent:Connect(function(plr, village)
print(village)
workspace:FindFirstChild(village).Value += 1
print(workspace:FindFirstChild(village).Value)
local starter = game.ReplicatedStorage:FindFirstChild(village).StarterCharacter
local clone = starter:Clone()
local kageclone = starter:Clone()
plr.Village.Value = village
local hat = game.ReplicatedStorage:FindFirstChild(village).Accessory:Clone()
if workspace:FindFirstChild(village).Value == 1 then
plr.Title.Value = kage[village]
print("hello")
for i,v in pairs(kageclone:GetChildren()) do
if v:IsA("Accessory") then
v:Destroy()
end
end
hat.Parent = kageclone
wait()
kageclone.Name = plr.Name
plr.Character = kageclone
kageclone.Parent = workspace
task.wait()
plr:LoadCharacter(kageclone)
print("Goodbye")
else
wait()
clone.Name = plr.Name
plr.Character = clone
clone.Parent = workspace
wait()
plr:LoadCharacter(clone)
end
plr.Team = game.Teams:FindFirstChild(village)
wait()
end)
game.Players.PlayerRemoving:Connect(function(plr)
if plr.Village.Value ~= "None" then
workspace:FindFirstChild(plr.Village.Value).Value -= 1
end
end)