```
local debounce = 0 --- this means the gui is closed
local menu = script.Parent.Parent.Frame -- quick way to reference the menu gui
script.Parent.MouseButton1Click:connect(function()
if debounce == 0 then -- checks if the menu is closed
debounce = 1 -- this means the menu is in process of sliding
for i = 1,10 do
wait(0.02)
menu.Position = menu.Position + UDim2.new(0.01,0, 0,0) -- this moves the gui
end
debounce = 2 -- this means the menu is open
elseif debounce == 2 then -- checks if the menu is open
debounce = 1 -- this means the menu is in process of sliding
for i = 1,10 do
wait(0.02)
menu.Position = menu.Position - UDim2.new(0.01,0, 0,0) -- this moves the gui
end
debounce = 0 -- this means the menu is closed
end
end)
```
'tech > game' 카테고리의 다른 글
21/08/06 How to Use Tweens and TweenService - Roblox Studio Tutorial (0) | 2021.08.06 |
---|---|
21/08/03 ROBLOX : Camera Control Tutorial (0) | 2021.08.03 |
21/08/02 Roblox Health Bar (custom) (0) | 2021.08.02 |
21/08/02 Billboard GUI (for Overhead Healthbar) (0) | 2021.08.02 |
21/08/02 BUILDING A THEME PARK IN ROBLOX! (0) | 2021.08.02 |