local function LoadChicken(plr: Player, reason: string)
while(wait()) do
plr.CharacterAdded:Wait()
local ChickenClone = ServerStorage.Chickens["Default Chicken"]:Clone()
ChickenClone.Name = plr.Name
plr.Character:Destroy()
plr.Character = ChickenClone
ChickenClone.Parent = workspace
local Animate = plr.Character:WaitForChild("Animate")
Animate.Disabled = false
end;
end
function ChickenService:Start()
Players.PlayerAdded:Connect(function(plr)
LoadChicken(plr)
end)
end
local function LoadChicken(plr: Player, reason: string)
local ChickenClone = ServerStorage.Chickens["Default Chicken"]:Clone()
ChickenClone.Name = plr.Name
plr.Character:Destroy()
plr.Character = ChickenClone
ChickenClone.Parent = workspace
local Animate = plr.Character:WaitForChild("Animate")
Animate.Disabled = false
end
function ChickenService:Start()
Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
LoadChicken(plr)
end
end)
end
you can add the charaterAdded event after the playeraddded so it will fire when the character joins the game and when the character respawns.
local function LoadChicken(player, reason)
local ChickenClone = ServerStorage.Chickens["Default Chicken"]:Clone()
ChickenClone.Name = player.Name
player.Character:Destroy()
player.Character = ChickenClone
ChickenClone.Parent = workspace
local Animate = player.Character:WaitForChild("Animate")
Animate.Disabled = false
end
Players.PlayerAdded:Connect(function(player)
player.CharacterAppearanceLoaded:Connect(function(char)
LoadChicken(player, "idk")
end)
end)
I changed some of the variables to make it easier to work with but it shouldn’t be hard to change them back/. But, the main thing I changed was taking the LoadChicken out of the function and replacing it with CharacterAppearanceLoaded. This just makes it so that every time you respawn/spawn in, it will run the function.