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

fade on death help?

game:GetService('Players').PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) character:WaitForChild("Humanoid").Died:connect(function() player.Torso.Transparency = 0.1 player.Torso.Transparency = 0.2 player.Torso.Transparency = 0.3 player.Torso.Transparency = 0.4 player.Torso.Transparency = 0.5 player.Torso.Transparency = 0.6 player.Torso.Transparency = 0.7 player.Torso.Transparency = 0.8 player.Torso.Transparency = 0.9 player.Torso.Transparency = 1

		player.RightLeg.Transparency = 0.1
		player.RightLeg.Transparency = 0.2
		player.RightLeg.Transparency = 0.3
		player.RightLeg.Transparency = 0.4
		player.RightLeg.Transparency = 0.5
		player.RightLeg.Transparency = 0.6
		player.RightLeg.Transparency = 0.7
		player.RightLeg.Transparency = 0.8
		player.RightLeg.Transparency = 0.9
		player.RightLeg.Transparency = 1
		
		player.LeftLeg.Transparency = 0.1
		player.LeftLeg.Transparency = 0.2
		player.LeftLeg.Transparency = 0.3
		player.LeftLeg.Transparency = 0.4
		player.LeftLeg.Transparency = 0.5
		player.LeftLeg.Transparency = 0.6
		player.LeftLeg.Transparency = 0.7
		player.LeftLeg.Transparency = 0.8
		player.LeftLeg.Transparency = 0.9
		player.LeftLeg.Transparency = 1
		
		player.RightArm.Transparency = 0.1
		player.RightArm.Transparency = 0.2
		player.RightArm.Transparency = 0.3
		player.RightArm.Transparency = 0.4
		player.RightArm.Transparency = 0.5
		player.RightArm.Transparency = 0.6
		player.RightArm.Transparency = 0.7
		player.RightArm.Transparency = 0.8
		player.RightArm.Transparency = 0.9
		player.RightArm.Transparency = 1
		
		player.LeftArm.Transpaerency = 0.1
		player.LeftArm.Transpaerency = 0.2
		player.LeftArm.Transpaerency = 0.3
		player.LeftArm.Transpaerency = 0.4
		player.LeftArm.Transpaerency = 0.5
		player.LeftArm.Transpaerency = 0.6
		player.LeftArm.Transpaerency = 0.7
		player.LeftArm.Transpaerency = 0.8
		player.LeftArm.Transpaerency = 0.9
		player.LeftArm.Transpaerency = 1
		
		player.Head.Transparency = 0.1
		player.Head.Transparency = 0.2
		player.Head.Transparency = 0.3
		player.Head.Transparency = 0.4
		player.Head.Transparency = 0.5
		player.Head.Transparency = 0.6
		player.Head.Transparency = 0.7
		player.Head.Transparency = 0.8
		player.Head.Transparency = 0.9
		player.Head.Transparency = 1
	end)
end)

end)

i am trying to make it where when a player dies, they fade away to nothing kind of like a ghost... some of u may have seen my other one but this one is a lot longer thanks to someone else who answered it... but it still doesnt work... what else do i need to do?

5 comments

0

If you're going to accept my help and not even acknowledge it, that's low. You won't last long on this site doing stuff like that.

0

i couldnt remember ur name and i forgot to add it... i wus planning on coming back... plus ur name doesn't have to shine all over the place

0

DID YOU READ MY ANSWER?

0

yeah i read it... it still didn't work but i think u have everything right... its probably just interferance with my ragdoll script or some other of the scripts

0

I'm not saying that you have to give me credit. I spent about 10 minutes writing the response on the last thread you posted, and didn't even get as much as a thank you. I don't like being taken for granted.

2 answers

I would add a wait() in between each line to make it fade. If you don't the script will think you want to turn everything transparent that second they die.

2 comments

0

i did wut u said but wut i meant before is it doesnt fade at all

0

Is it in a LocalScript and in the StarterGui or StarterPack?

	for i = 1, 10 do
	wait(1)
	if player.Character then
	--This is assuming you have the player variable
    	player.Character:FindFirstChild("Right Leg").Transparency = i/10
	player.Character:FindFirstChild("Left Leg").Transparency = i/10
        player.Character:FindFirstChild("Right Arm").Transparency = i/10
        player.Character:FindFirstChild("Left Arm").Transparency = i/10
	player.Character:FindFirstChild("Head").Transparency = i/10
		end
	end


--SO:

game.Players.PlayerAdded:connect(function(plr)
	print(plr.Name)
	plr.CharacterAdded:connect(function(char)
		local hum = char:FindFirstChild("Humanoid")
		if hum then
			hum.Died:connect(function()
				for i = 1, 10 do
				wait(1)
				if plr.Character then
				    plr.Character:FindFirstChild("Right Leg").Transparency = i/10
					plr.Character:FindFirstChild("Left Leg").Transparency = i/10
				    plr.Character:FindFirstChild("Right Arm").Transparency = i/10
				    plr.Character:FindFirstChild("Left Arm").Transparency = i/10
					plr.Character:FindFirstChild("Head").Transparency = i/10
					plr.Character:FindFirstChild("Torso").Transparency = i/10
				    end
				end
			end)
		end
	end)
end)

        

1 comment

0

Don't just post code! Explain your answers in detail! Also, you use 'player' on line three but there is no 'player' variable, which will result in an error.

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