local player = game.Players.LocalPlayer
local gui = script.Parent
local Open = false
function onKeyPress(inputObject, gameProcessedEvent)
if inputObject.KeyCode == Enum.KeyCode.R then
if (Open == false) then
print("Open is False!")
for i = 1,0,-0.1 do
gui.BackgroundTransparency = i
wait()
end
Open = true
print("Open is now True!")
elseif (Open == true) then
print("Open is now True!")
for k = 0,1,0.1 do
gui.BackgroundTransparency = k
wait()
end
Open = false
print("Open is False!")
end
end
end
game:GetService("UserInputService").InputBegan:connect(onKeyPress)
COMMUNITY QUESTION
UserInputService GUI Transparency problems. Any help here?
0 answers
No public answers were preserved for this question.
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
for i and k doesnt have a cooldown everytime the value increases so it instantaneously goes to 1. Consider placing a wait() below each “gui.BackgroundTransprency = yada-yada”.
I put a print at the first part of the script where it detects if Open is indeed false, and it worked there, but the other part of the script failed and didn't print anything