ScreenGui Frame not unfading on characteradded

I have these two scripts and the first once seems to work fine but the second one doesn’t work for some reason.

Fading Script on humanoid death

local player = game.Players.LocalPlayer

local FD = player:WaitForChild("PlayerGui"):WaitForChild("TipsAndInterface").FadingDeath

local char = player.Character or player.CharacterAdded:Wait()

local hum = char:WaitForChild('Humanoid')

hum.Died:Connect(function()

wait(.7)

for i = 1,100 do

FD.BackgroundTransparency -= 0.02

wait(.001)

end

end)

Unfading Script on characteradded

player.CharacterAdded:Connect(function()
	for i = 1,100 do
		FD.BackgroundTransparency += 0.05
		wait(.001)
	end
end)

scripts are located in startercharacterscripts btw

I have found the issue it seems the script. is making the transparency go over 1 for some reason. I’m not sure how I would fix this though.

found a solution

hum.Died:Connect(function()
	wait(.3)
	repeat
		FD.BackgroundTransparency -= 0.01
		wait()
	until
	FD.BackgroundTransparency <= 0
	FD.BackgroundTransparency = 0
end)

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