How do I light up and make a sword longer during animation?

So i’m trying to make it so that during the animation the sword my character is holding will glow and light up? Is there anything I can do to do that? I tried moonanimator but i dont rlly know if there is a feature that can change those properties. I also tried scripting it but it won’t work.

It will require scripting. You can add a named keyframe in your animation when you want the sword to light up and have a LocalScript referencing the sword listen for they keyframe reached signal pertaining to it.

Can you teach me how? I tried changing it’s properties before and after the animation. But since i have a class system or something that sends everything to the player’s backpack, the sword blade is inside a startercharacter model. If I do something like

local blade = script.parent.CharacterModel.Blade

it doesn’t work because the blade will go to workspace and the local blade script is finding it inside the backpack. I tried making the script find it in workspace but it doesnt work idk why it says it cant change the material. Do you know how I can do this?