Alright, so I am trying to make a GUI that opens/closes when when the user presses the 'E' key. It looks to me I did everything how the wiki showed. Although when I press 'E' nothing happens. Here is my code.
local UserInputService = game:GetService("UserInputService")
function onInputBegan(input, gameProcessed)
if input.UserInputType == Enum.UserInputType.Keyboard then
local keyPressed = input.KeyCode
if keyPressed == 101 then
if script.Parent.Open == false then
script.Parent.Visible = true
else
script.Parent.Visible = false
end
end
end
end
UserInputService.InputBegan:connect(onInputBegan)

1 comment
This script looks ok except its best to use Enums instead of the int value for the key, how far does this script run you can do this by adding in prints.