Script not running after being enabled

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:

In your morph script try setting the players character to the model before parenting it to the workspace

huh that worked silly me i guess

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.