R

toggle button klose open (lollypophub)

public
rrixh Apr 01, 2024 Never 74
Clone
Lua toggle_lulaslollipop.png 55 lines (47 loc) | 1.8 KB
1
--Open/Klose GUI frame--
2
local LollypopHub_mobile = Instance.new("ScreenGui")
3
local Frame = Instance.new("Frame")
4
local TextButton = Instance.new("TextButton")
5
local Frame2 = Instance.new("Frame")
6
local TextButton2 = Instance.new("TextButton")
7
8
LollypopHub_mobile.Parent = game.CoreGui -- to make the UI stay
9
10
Frame.Parent = LollypopHub_mobile
11
Frame.BackgroundColor3 = Color3.fromRGB(0, 255, 0)
12
Frame.Position = UDim2.new(0.858712733, 0, 0.1050062257, 0)
13
Frame.Size = UDim2.new(0, 90, 0, 30)
14
Frame.Active = true
15
Frame.Draggable = true
16
17
TextButton.Parent = Frame
18
TextButton.BackgroundColor3 = Color3.fromRGB(148, 0, 211)
19
TextButton.Size = UDim2.new(0, 90, 0, 30)
20
TextButton.Font = Enum.Font.GothamBold
21
TextButton.Text = "OPEN"
22
TextButton.TextColor3 = Color3.fromRGB(0, 0, 0)
23
TextButton.TextSize = 22.000
24
TextButton.MouseButton1Click:Connect(function()
25
Frame.Visible = false
26
Frame2.Visible = true
27
local vim = game:service("VirtualInputManager")
28
vim:SendKeyEvent(true, "Insert", false, game)
29
end)
30
31
Frame2.Parent = LollypopHub_mobile
32
Frame2.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
33
Frame2.Position = UDim2.new(0.858712733, 0, 0.1050062257, 0)
34
Frame2.Size = UDim2.new(0, 90, 0, 30)
35
Frame2.Active = true
36
Frame2.Draggable = true
37
38
TextButton2.Parent = Frame2
39
TextButton2.BackgroundColor3 = Color3.fromRGB(128, 0, 32)
40
TextButton2.Size = UDim2.new(0, 90, 0, 30)
41
TextButton2.Font = Enum.Font.GothamBold
42
TextButton2.Text = "KLOSE"
43
TextButton2.TextColor3 = Color3.fromRGB(0, 0, 0)
44
TextButton2.TextSize = 22.000
45
TextButton2.MouseButton1Click:Connect(function()
46
Frame2.Visible = false
47
Frame.Visible = true
48
local vim = game:service("VirtualInputManager")
49
vim:SendKeyEvent(true, "Insert", false, game)
50
end)
51
52
53
54
Frame.Parent.Active = true
55
Frame.Parent.Draggable = true