UPDATED
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local Gui = game.StarterGui
local DevMenu = Gui.DevMenu
local Main = Gui.DevMenu.MainFrame
local Sound = DevMenu.Activater.Sound_1
if Player.Name == "Player1" then
game:GetService("UserInputService").InputBegan:Connect(function(input,chat)
if not chat then
if input.KeyCode == Enum.KeyCode.X then
Sound:Play()
print("X is down.")
DevMenu.Enabled = true
else
DevMenu.Enabled = false
end
end
end)
end
For some reason this wont make the Gui appear when I press x. This is in a LocalScript. When I press X the code fires and I see the the "X is down" in output. Any help is appreciated!

4 comments
I don't see 'Gui' defined anywhere - have you defined it in your script? It is most likely the reason it does not work.
Not the problem.
You seem to be missing an end at the bottom of your code. You should fix your formatting so it can be easy to tell when you're missing something.
Yeah, that didn't work either.