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.
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