Keybinding not working at all, unable to fix it. What am I doing wrong?
Alright so, i'm a relatively new scripter on ROBLOX and i've been trying to figure out what I am missing.
Nothing has worked to get this to work and i'm entirely lost on what i'm missing.
Basically, i'm trying to get the script to when I hit T it searches to see if the tween is already in position one and if it is, then to move it to position two and vice versa. I was able to get the mouse part to work but I don't know how to do the rest.
I want this to be able to be on a loop, meaning it works after one press.
01 | local frame = script.Parent.Parent.Parent:WaitForChild( "Titantrons" ) |
02 | local frame 2 = game.Players.LocalPlayer.PlayerGui.ControlGUI.Frame:WaitForChild( "Titantrons" ) |
03 | local hotkey = Enum.KeyCode.T |
04 | local UIS = game:GetService( "UserInputService" ) |
07 | UIS.InputBegan:Connect( function (key, gp) |
09 | if UIS:GetFocusedTextBox() = = nil then |
10 | if toggle = = false then |
11 | frame 2 :TweenPosition(UDim 2. new( 0.003 , 0 , 0 , 0 ), 'Out' , 'Bounce' , 1 ) |
14 | frame 2 :TweenPosition(UDim 2. new( 0.003 , 0 , 1.3 , 0 ), 'Out' , 'Bounce' , 1 ) |
21 | script.Parent.MouseButton 1 Click:Connect( function (click) |
22 | if toggle = = false then |
23 | frame:TweenPosition(UDim 2. new( 0.003 , 0 , 0 , 0 ), 'Out' , 'Bounce' , 1 ) |
26 | frame:TweenPosition(UDim 2. new( 0.003 , 0 , 1.3 , 0 ), 'Out' , 'Bounce' , 1 ) |
Thanks in advance to anyone who helps.