Okay so, I’ve just made a script that uses UserInputService and TweenService. There are quite a few common bugs, such as the letterBox not tweening away, or the blur not going, this tend to happen if I press the required key to many times.
local UIS = game:GetService("UserInputService")
local TS = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Quint)
local SettingsKey = Enum.KeyCode.Q
local blur = game.Lighting:WaitForChild("Blur")
UIS.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.Keyboard then
if input.KeyCode == SettingsKey then
if script.Parent.Parent.Name == game.Players.LocalPlayer.Name then
script.Parent.Parent.PlayerGui.LetterBox.L2:TweenPosition(UDim2.new(0, 0,0.882, 0),"Out","Quart",0.5,false)
script.Parent.Parent.PlayerGui.LetterBox.L1:TweenPosition(UDim2.new(0, 0,0, 0),"Out","Quart",0.5,false)
TS:Create(blur, tweenInfo, {Size = 16}):Play()
end
end
end
end)
UIS.InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.Keyboard then
if input.KeyCode == SettingsKey then
if script.Parent.Parent.Name == game.Players.LocalPlayer.Name then
script.Parent.Parent.PlayerGui.LetterBox.L2:TweenPosition(UDim2.new(0, 0,1, 0),"Out","Quart",0.5,false)
script.Parent.Parent.PlayerGui.LetterBox.L1:TweenPosition(UDim2.new(0, 0,-0.15, 0),"Out","Quart",0.5,false)
TS:Create(blur, tweenInfo, {Size = 0}):Play()
end
end
end
end)
Thanks. ![]()