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

Why is my script tweening not working, There is not differences between both tweens?

Script: Problem: The second Tween which returns the GUI to its formal position is not working, there are no errors that show up in the output How do I fix this? (After line 8)

script.Parent.Info.MouseButton1Click:Connect(function()
	local GUI = script.Parent.Frame
	local debounce = false

	if debounce == false then
		debounce = true
		GUI:TweenPosition(UDim2.new(0.32, 0,0.284, 0),"InOut","Sine",0.5, true)
	elseif debounce == true then
		debounce = false
		GUI:TweenPosition(UDim2.new(0.32, 0,1.1, 0),"InOut","Sine",0.5, true)
	end
end)

1 answer

✓ Accepted answer

Define the debounce variable outside of the function as it will always be false inside of the function.

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