This is very old coding, and I’m not sure what broke this; but essentially.. if a certain letter like G is pressed.. it’ll open a UI. If the person is typing in the chatbox and hits G, it shouldn’t open the UI.
What broke in this coding when using the new chat system?
--[[Made By Just2Terrify]]
--/Variables\--
local UIS = game:GetService("UserInputService")
--/Functions\--
local function TweenTabControl()
local Panel = script.Parent["Settings Frame"]
local Button = script.Parent["Control Button"]
local KeybindValue = script.KeybindValue.Value
if Panel.Position == (UDim2.new(-1, 0, Panel.Position.Y.Scale, 0)) then
spawn(function()Panel:TweenPosition(UDim2.new(0, 0, Panel.Position.Y.Scale, 0), 'In', 'Linear', 0.5) end)
Button.Text = "CLOSE ".."["..KeybindValue.."]"
Button.TextColor3 = Color3.fromRGB(255,255,255)
Button.BackgroundColor3 = Color3.fromRGB(170,0,0)
else
spawn(function()Panel:TweenPosition(UDim2.new(-1, 0, Panel.Position.Y.Scale, 0), 'In', 'Linear', 0.5) end)
Button.Text = "Controls ".."["..KeybindValue.."]"
Button.TextColor3 = Color3.fromRGB(0,0,0)
Button.BackgroundColor3 = Color3.fromRGB(0, 170, 255)
end
end
--/Main Script\--
UIS.InputBegan:Connect(function(KeyPressed)
if UIS:GetFocusedTextBox() then
return
end
local Key = Enum.KeyCode
local KeybindValue = script.KeybindValue.Value
if KeyPressed.KeyCode == Key[KeybindValue] then
TweenTabControl()
end
end)