I've made a script that detects when a specific key is pressed. I have tried putting a print function to see if it was detected or not and it did not print the message. Could it be something to do with studio?
Script:
local uis = game:GetService("UserInputService")
local plr = game.Players.LocalPlayer
local chatting = false
local frame = script.Parent
plr.Chatted:connect(function(msg)
chatting = false
end)
uis.InputBegan:connect(function(input)
if input == Enum.KeyCode.Slash and game.StarterGui:GetCoreGuiEnabled("Chat") then
chatting = true
elseif input == Enum.KeyCode.Return then
chatting = false
end
if chatting == false then
if input == Enum.KeyCode.Equals then
frame.Visible = not frame.Visible
end
end
end)
I am using a localscript btw

3 comments
are you using a local script or script if its a script it wont work you have to use local script for input
I am using a LocalScript
you also need gameProcessed as an argument