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

How to Fade a ScreenGUI on Character Spawn?

I have a frame in StarterGui that is supposed to fade from BackgroundTransparency 0 to 1 when the character is added into the game, including respawns and first join. I tried this script, located under the frame, but it didn't work.

local plr = game:GetService("Players").LocalPlayer
local blood = script.Parent
local ts = game:GetService("TweenService")
local goal = {BackgroundTransparency = 1}
local info = TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
local tween = ts:Create(blood, info, goal)
plr.CharacterAdded:Connect(function()
	blood.BackgroundTransparency = 0
	tween:Play()
	wait(1)
	blood.BackgroundTransparency = 1
end)

Please help.

1 answer

✓ Accepted answer

Place this Localscript into "StarterCharacterScripts" and remove the character added function but keep its contents.

This will play the Tween whenever your character respawns, including spawning in for the first time.

The GUI can be accessed through plr.PlayerGui.blood

2 comments

0

Thanks, this worked!

0

And I see now how it does too

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