Why doesn't this tween play?

  1. What do you want to achieve? A GUI tween

  2. What is the issue? The tween doesn’t play

  3. What solutions have you tried so far? I’ve checked the dev hub and some topics but nothing has provided me with a solution

here’s the script

Effects.Sleep = function(player, caster)
	local sleepGUI = player.PlayerGui.SleepGUI
	
	sleepGUI.MainFrame.Sleep = caster:GetAttribute("Name").." has put you to sleep..."
	sleepGUI.MainFrame.WakeUp = "You will wake up shortly."
	
	for i, v in pairs(sleepGUI:GetDescendants()) do
		if v:IsA("Frame") then
			TweenService:Create(v, TweenInfo.new(1), {BackgroundTransparency = 0}):Play()
		end
		if v:IsA("TextLabel") then
			TweenService:Create(v, TweenInfo.new(1), {Transparency = 0}):Play()
		end
	end
end

all help would be appreciated

Did that code throw any errors?

i think u wanted to change text?

sleepGUI.MainFrame.Sleep.Text = caster:GetAttribute("Name").." has put you to sleep..."
sleepGUI.MainFrame.WakeUp.Text = "You will wake up shortly."
2 Likes

Oh good find xD it could just be an error then.

I think u are missing the Easing Style and Easing Direction

You don’t need to input an easing style and direction for a tween to work.

1 Like

Try printing inside the for loop, are you sure there’s actually any descendants in sleepGUI at all?

none at all, the code just stops

oh, I haven’t noticed that, let me see if that makes a difference