So basically, you need to add some more connections and event listeners in your script. To do this your going to have convert from a LocalScript to a ServerScript(or regular script in broad terms.)
The main reason it only works once, is because you don't have an event for when the character respawns. This can be done by using Character Added. This fires the even every time character respawn. To use this event, you need to redefine player in a different way because this can't be used in local scripts. So essentially this how it should be.
01 | game.Players.PlayerAdded:connect( function (player) |
02 | player.CharacterAdded:connect( function (char) |
03 | local humanoid = char:WaitForChild( "Humanoid" ) |
04 | for i,part in pairs (char:GetChildren()) do |
05 | if part and part:IsA( "BasePart" ) and ( part.Name = = "Left Arm" or part.Name = = "Right Arm" ) then |
06 | part.LocalTransparencyModifier = part.Transparency |
07 | part.Changed:connect( function (property) |
08 | part.LocalTransparencyModifier = part.Transparency |