This sounds weird in the title but what I really mean is that I want this script to be able to press T only and it opens this shop GUI with sound effect and position I added. The problem is I only want the GUI to NOT be activated when chatting, because then it gets annoying. So I did research and added some parts of the gameproccessed script but it makes it worse. So how do I make it only T opens/closes the GUI?
local UserInputService = game:GetService("UserInputService")
local FrameObject = script.Parent.Parent.Frame
local PositionClosed = UDim2.new(0.15,0,0.036, 0)
local PositionOpen = UDim2.new(0.15,0,0.078, 0)
game:GetService("UserInputService").InputBegan:Connect(function(keyCode, gameProcessed)
if keyCode.keyCode == Enum.KeyCode.T and not gameProcessed then
FrameObject.Visible = true
script.Opening:Play()
FrameObject:TweenPosition((PositionClosed),'Out','Linear',0)
FrameObject.Visible = false
else
FrameObject.Visible = false
script.Opening:Play()
FrameObject:TweenPosition((PositionOpen),'Out','Linear',.15)
FrameObject.Visible = true
end
end)

1 comment
Guess you're right, but that doesn't solve the problem as if I say were typing in chat with words containing "g" same thing