============================================================================================================
player = script.Parent.Parent
mouse = player:GetMouse()
local open = false
mouse.KeyDown:connect(function (key)
key = key:lower()
if key == "e" then
local keyConnection = mouse.KeyUp:connect(function (key)
if key == "e" then
open = false
if (open == false) then repeat
wait()
player.PlayerGui.ScreenGui.Frame.Position = player.PlayerGui.ScreenGui.Frame.Position + UDim2.new(0.01,0,0,0)
until open == true
keyConnection:disconnect()
if keyConnection:disconnect() then
open = true
if (open == true) then
player.PlayerGui.ScreenGui.Frame.Position = player.PlayerGui.ScreenGui.Frame.Position - UDim2.new(0,0,0,0)
end
end
end
mouse.KeyDown:connect(key)
============================================================================================================
trying to make a 2D GUI game like Mario |