Player = game.Players.LocalPlayer
gui = script.Parent
Mouse = Player:GetMouse()
Box = script.Parent
Open = false
game.GetService("UserInputService").InputBegan:Connect(function(key)
if key.Keycode == Enum.Keycode.R then
if (Open == false) then
Box.Transparency = 0
Open = true
elseif (Open == true) then
Box.Transparency = 1
Open = false
end
end
end)
This is the code I have made. Whenever I press R nothing happens. Not sure what I did wrong.

5 comments
Might want to put in into a code block for people to read easier.
Thanks for the suggestion
Oh and by "disappear" you mean destroy the part or just set it to transparent?
I mean to set the transparent
Uh, at first, you need to make LocalScript with this text and put it in "StarterGear"(or Pack). At second, you need to change "Box = script.Parent" so "Box = game.Workspace.(yourpartname)". And this will work.