I just want the gui to appear when I press "c" This is in a local script.
player = game.Players.LocalPlayer function onKeyDown(key) key:lower() if key == "c" then player.PlayerGui.Interface.Statistics.Visible = true end end
You should be using user input service with everything you do that relates to that.
game:GetService("UserInputService").InputBegan:connect(function(input,proc) --we get the userinput service. we need proc to start it from activating while chatting if input.KeyCode == Enum.KeyCode.C then --STUFF HERE end end) --Also you can change input began to input end for ending inputs.
if this helped your welcome :D ~KIHeros (oh and please (upvote and) accept :P)
The reason it didn't work:
You needed to call the function.
local player = game.Players.LocalPlayer local mouse = p:GetMouse() -- your func mouse.KeyDown:connect(onKeyDown)