Issue with Tween Service

I’m making a party system for my game and I’m trying to make an open and close tween. It works whenever I open it but never works when I press it again to close it. Why?

local function invbuttonpressed ()
	if not playerlistactive then
		print("False")
		updatelist()
		tweenoverride1 = tweenservice:Create(mainframe.PlayerListFrame, tweeninfo1, {Position = UDim2.new({0.002, 0,0.002, 0})})
		tweenoverride1:Play()
		playerlistactive = true
	else
		print("True")
		tweenoverride1 = tweenservice:Create(mainframe.PlayerListFrame, tweeninfo1, {Position = UDim2.new({-0.678, 0, 0, 0})})
		tweenoverride1:Play()
		playerlistactive = false
	end
end

Can you include an image, a short video, or an output screen in here? You may have to post more code of where this function is called.

Hey there, as Jacky2804 said, you may need to provide some sort of media to show us what exactly is going on. Also can you show more of the code so I can get a complete understanding?

Remove the brackets for the UDim2.new() parts… it should work perfectly now

1 Like

Thanks it works now! It’s strange though how it still works on the top one if they both have the incorrect format.

Posting large amounts of code can be confusing to some people, so I made sure to keep it simple.

1 Like

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