I have a system where you can switch between characters based on gender. When you join, you are defaulted to a character, and it changes based on what you set when you left the game last. When it changes at first, the script runs fine and the script is enabled fine. However, when I try to change my character, it successfully changes but does not enable the custom Animate script. I don’t understand why, considering that it’s enabled from the server. However, if I manually enable it through studio it works. Any help would be appreciated!
Enabling code (location: ServerScriptService):
players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
if character:WaitForChild("Animate"):HasTag("starterScript") then
wait(1)
character.Animate.Enabled = true
warn("the players animation script has been enabled!!!")
-- this code runs when a character is changed manually
else
character.Animate:Destroy()
local newAnimation = script.Animate:Clone()
newAnimation.Parent = character
warn("the players animation script has changed!!!")
-- this code runs when the player first joins and roblox adds their animator
end
end)
end)
Visual: