Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

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

Asked by
Jo1nts 134
3 years ago

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)

01script.Parent.Info.MouseButton1Click:Connect(function()
02    local GUI = script.Parent.Frame
03    local debounce = false
04 
05    if debounce == false then
06        debounce = true
07        GUI:TweenPosition(UDim2.new(0.32, 0,0.284, 0),"InOut","Sine",0.5, true)
08    elseif debounce == true then
09        debounce = false
10        GUI:TweenPosition(UDim2.new(0.32, 0,1.1, 0),"InOut","Sine",0.5, true)
11    end
12end)

1 answer

Log in to vote
0
Answered by 3 years ago

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

Ad

Answer this question