Transparency tween not playing

im trying to make a transparency tween appear when a player clicks a button, ive done everything right and it all works perfectly fine with no error, but the tween just doesnt happen.

i dont know if it actually does happen and im just forgetting to add something or not

heres the tween play part of the script

button.MouseButton1Click:Connect(function()
	black.Visible = true
	tween:Play()
	char:MoveTo(spawns)
	button.fall:Play()
	button.ring:Play()
	zoom.Disabled = false
	uis.MouseIconEnabled = false
	hum.WalkSpeed = 9
	frame.Visible = false
	tween2:Play()
	menu.Enabled = false
end)

heres a part of the locals in the script

local black = script.Parent.Parent.Parent.black

local ts = game:GetService("TweenService")
local ti = TweenInfo.new(3,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0)
local goal = {BackgroundTransparency = 0}
local goal2 = {BackgroundTransparency = 1}

local tween = ts:Create(black,ti,goal)
local tween2 = ts:Create(black,ti,goal2)

put the tween parameters in serverscript. you are not defining the tween in local script.

if i do that, how do i play the tween back in the local script since this is for a loading screen gui

Oh, Then define the tween parameter in the local script.

i forgot to ask, what exactly do you mean by “defining the tween parameters”, could you give an example?

local tween = ts:Create(black,ti,goal)
local tween2 = ts:Create(black,ti,goal2)

button.MouseButton1Click:Connect(function()
	black.Visible = true
	tween:Play()
	char:MoveTo(spawns)
	button.fall:Play()
	button.ring:Play()
	zoom.Disabled = false
	uis.MouseIconEnabled = false
	hum.WalkSpeed = 9
	frame.Visible = false
	tween2:Play()
	menu.Enabled = false
end)

i did that, i tested the game while looking at the properties of the frame at the same time and apparently the tween works, the visibility is on too, but for some reason the frame isnt appearing

and it also takes more than 1 clicks to activate the tween for some reason

i solved it by adding a new tweeninfo somehow

1 Like

Please Mark my reply as the solution.