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

Gui wont slide when password/code is wrong, Is there something missing?

Asked by 4 years ago

Hello robloxians! I wants to do that: if someone enters the wrong password, the gui password appears in the animation and disappears. But he does not want to act. Somebody knows why?

local Wrongpasswordtryagain = script.Parent
game:GetService("UserInputService").InputBegan:Connect(function(InputObject, Wrongpasswordtryagain)
        if InputObject.Key == Enum.KeyCode.Enter then
            script.Parent.Parent.Parent.Wrongpasswordtryagain.Visible = true
            coroutine.resume(coroutine.create(function()
                Wrongpasswordtryagain:TweenPosition(UDim2.new(0.5, 0, 0.0, 0))
                wait(5)Wrongpasswordtryagain:TweenPosition(UDim2.new(0.5, 0, -0.3, 0))
            end))
    end
end)
0
TextBox.FocusLost(function(PressedReturn)) is a more efficient way of handling this. Ziffixture 6913 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

It seems that you have something missing from your Tween; you were missing the Tween Style the Tween time, In or out, and true. You did

TweenPosition(UDim2.new(0.5,0,0.0,0))

but if you put in all the values it would work. For example

TweenPosition(UDim2.new(0.5,0,0.0,0),"Out","Linear",1,true)

Hopes this helps!

0
It actually just defaults. You should also note that these functions are asynchronous, a use for a coroutine is unnecessary. Ziffixture 6913 — 4y
0
ok thankyou will note Nifemiplayz 32 — 4y
Ad

Answer this question