Alright so I have some keys set up so when you press them it brings up the GUI. Well problem is they happen to come up while chatting as well. So if I want to type "Hey" it'll bring up my Help GUI because I set H to do that, here is the code, is there a way to get rid of this?
local player = script.Parent.Parent
local guis = game.ReplicatedStorage.PopUps
function onKeyPress(inputObject, gameProccessedEvent)
if inputObject.KeyCode == Enum.KeyCode.H then
local help = guis.Help:Clone()
help.Parent = player.PlayerGui
player.PlayerGui.PlayerAudio.Pullup:Play()
end
end
end
game:GetService("UserInputService").InputBegan:connect(onKeyPress)
function onKeyPress(inputObject, gameProccessedEvent)
if inputObject.KeyCode == Enum.KeyCode.Q then
local options = guis.Options:Clone()
options.Parent = player.PlayerGui
player.PlayerGui.PlayerAudio.Pullup:Play()
end
end
game:GetService("UserInputService").InputBegan:connect(onKeyPress)

1 comment
Thanks! :D