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

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

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)

1 comment

0

TextBox.FocusLost(function(PressedReturn)) is a more efficient way of handling this.

1 answer

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!

2 comments

0

It actually just defaults. You should also note that these functions are asynchronous, a use for a coroutine is unnecessary.

0

ok thankyou will note

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