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
2 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)

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

Log in to vote
0
Answered by 2 years ago

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

Ad

Answer this question