Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

I've been playing around with free models trying to learn things...how do i....?

...How do I insert this script into each of my player's limbs as well as my player's head and torso?

I also want it to do this each time they spawn, so It will come back if they die or reset.

while true do
	for i=1, 9, 1 do
		script.Parent.Transparency = i * .1
		wait(.1)
	end
	for i=9, 1, -1 do
		script.Parent.Transparency = i * .1
		wait(.1)
	end
end

3 comments

1

That will make their transparency lower...what are you trying to do here? Explanation please?

0

It lowers the transparency then raises it again infinitely..

0

It's better the loop through all the parts and do that in one script, then putting that in every part.

2 answers

✓ Accepted answer

I recommend doing

--Insert into StarterGui as a LocalScript
player = game.Players.LocalPlayer
repeat wait() until player.Character
char = player.Character
Head = char:WaitForChild('Head') --Waits for Head
Torso = char:WaitForChild('Torso') --Waits for Torso
LeftArm = char:WaitForChild('Left Arm') --Waits for Left Arm
RightArm = char:WaitForChild('Right Arm') --Waits for Right Arm
LeftLeg = char:WaitForChild('Left Leg') --Waits for Left Leg
RightLeg = char:WaitForChild('Right Leg') --Waits for Right Leg
--Tip: when refering to a model or script with a space in it, use [''].
-- Ex. char.['Left Leg'].Transparency = 0
while true do
    for i=1, 9, 1 do
		Head.Transparency = i * .1
		Torso.Transparency = i * .1
		LeftArm.Transparency = i * .1
		RightArm.Transparency = i * .1
		LeftLeg.Transparency = i * .1
		RightLeg.Transparency = i * .1
        wait(.1)
    end
    for i=9, 1, -1 do
     		Head.Transparency = i * .1
		Torso.Transparency = i * .1
		LeftArm.Transparency = i * .1
		RightArm.Transparency = i * .1
		LeftLeg.Transparency = i * .1
		RightLeg.Transparency = i * .1
        wait(.1)
    end
end


I threw in the WaitForChilds just as a precaution so that it will wait for the limbs to load up.

This should work. I'm sure there's an easier way to do this, but this is what I thought of off the top of my head.

game.Players.PlayerAdded:connect(function(Player)
Player.CharacterAdded:connect(function(Character)
for _, Parts in next, Character:GetChildren()
if Parts.ClassName == 'Part' then

-- your code here

end
end
end)
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.