Function of a click of text button isn't working. why?
hello everyone, i made a gui consisting of frames. in the following script(local script inside of the frame) i want a script in which a player when enters his name in textbox makes a gui tween, but the tween part doesn't work after i click the button for the same.
here's the local script:-
01 | local player = game.Players.LocalPlayer |
02 | local textBox = player.PlayerGui.OrderGui:WaitForChild( "MainFrame" ).TextBox |
03 | local MainFrame = player.PlayerGui.OrderGui.MainFrame |
04 | local MainFrame 2 = player.PlayerGui.OrderGui.MainFrame 2 |
05 | local Players = game.Players:GetPlayers() |
06 | local functionEnabler = false |
07 | local EnterButton = player.PlayerGui.OrderGui.MainFrame.EnterButton |
08 | local Players = game.Players:GetPlayers() |
10 | textBox:GetPropertyChangedSignal( "Text" ):Connect( function () |
12 | EnterButton.MouseButton 1 Click:Connect( function () |
14 | local NameEntered = textBox.Text |
16 | for _,v in pairs (Players) do |
17 | if player.Name = = v.Name then |
19 | functionEnabler = true |
22 | functionEnabler = false |
27 | game.StarterGui.OrderGui.MainFrame.SelectUserButton.MouseButton 1 Click:Connect( function () |
28 | if functionEnabler = = true then |
29 | print ( "tween started" ) |
30 | MainFrame:TweenPosition(UDim 2. new( 0.294 , 0 , - 2 , 0 ), 'Out' , 'Linear' , 1 ) |
32 | MainFrame 2 :TweenPosition(UDim 2. new( 0.294 , 0 , 0.127 , 0 ), 'Out' , 'Sine' , 1 ) |