Hello. I do not know anything about scripts, so please help me. How can I write that if I enter the wrong password, another gui from (animation) UDim2.new shows and hides after a few seconds? This is my script:
local TextBox = script.Parent TextBox.FocusLost:Connect(function(enterPressed, inputThatCausedFocusLost) if enterPressed then if script.Parent.Parent.TextBox.Text == "ok" then script.Parent.Parent.Parent.Login.Visible = true script.Parent.Parent.Parent.Wrongpasswordtryagain.Visible = true wait(5) script.Parent.Parent.Parent.Wrongpasswordtryagain.Visible = false end end end)
And should i gui animation put here?
move the THEUIOBJECTHATWILLAPPEAR to a position not visible to the player.
game:GetService("UserInputService").InputBegan:Connect(function(InputObject) if ORIGINALUIOJBECT.Visible then if InputObject.Key == Enum.KeyCode.Enter then coroutine.resume(coroutine.create(function() ORIGINALUIOJBECT.Visible = false THEUIOBJECTHATWILLAPPEAR:TweenPosition(UDim2.new(POSITION)) wait(5)THEUIOBJECTHATWILLAPPEAR:TweenPosition(UDim2.new(THEUIORIGINALPOSITION)) end)) end end end)
I am not very sure what you want but this is what I think the answer is
local TextBox = script.Parent TextBox.FocusLost:Connect(function(enterPressed, inputThatCausedFocusLost) if enterPressed then if script.Parent.Parent.TextBox.Text == "ok" then script.Parent.Parent.Parent.Login.Visible = true script.Parent.Parent.Parent.Wrongpasswordtryagain.Visible = false else script.Parent.Parent.Parent.Wrongpasswordtryagain.Visible = true script.Parent.Parent.Parent.Login.Visible = false