Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function module.CloseFrame(frameName)
- local frame = module.GetFrame(frameName)
- if frame then
- local normalSize = frame.Size
- local closeTween = tweenService:Create(
- frame,
- TweenInfo.new(
- CloseSpeed,
- ClosingEasingStyle,
- ClosingEasingDirection),
- {
- Size = UDim2.fromScale(0, 0)
- }
- )
- closeTween:Play()
- closeTween.Completed:Connect(function()
- frame.Visible = false
- frame.Size = normalSize
- end)
- end
- end
- for _, v in pairs(screenGui:GetDescendants()) do
- if v:IsA("GuiButton") then
- if v:FindFirstChild("Opens") then
- if v:FindFirstChild("Opens").Value ~= nil then
- v.MouseButton1Click:Connect(function()
- module.OpenFrame(v:FindFirstChild("Opens").Value.Name)
- end)
- end
- end
- if v:FindFirstChild("Closes") then
- if v:FindFirstChild("Closes").Value ~= nil then
- v.MouseButton1Click:Connect(function()
- module.CloseFrame(v:FindFirstChild("Closes").Value.Name)
- end)
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement