Hi, I have a problem, and it is that the script is not executed when pressing the key, it should do its function but it does not. try to change the elseif and if values but it doesn’t work, the script only works if I change it manually with the mouse.
local Open = false
local buttonPressed = false
local UisTiempo = 0.8
local UserInputService = game:GetService("UserInputService")
local KeyClose = script.Parent.KeyClose
UserInputService.InputBegan:Connect(function(key)
if (key.KeyCode.Name == keyText) then
if not buttonPressed then
if KeyClose.Value == false then
if Open then
Open = false
buttonPressed = true
script.Parent.Value = true
wait(UisTiempo)
buttonPressed = false
elseif KeyClose.Value == true then
Open = true
buttonPressed = true
script.Parent.Value = false
wait(UisTiempo)
buttonPressed = false
end
end
end
end
end)