-
Notifications
You must be signed in to change notification settings - Fork 318
/
DogePlayz UI lib
173 lines (139 loc) · 5.25 KB
/
DogePlayz UI lib
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
--One of doge's first UI Libs. Don't judge it. Go show him support by using his scripts
--https://github.com/DogePlayz-Dev/DogeScripts
local dog = {}
-- Instances:
local DogeHubGUI = Instance.new("ScreenGui")
local Main = Instance.new("ImageLabel")
local Main2 = Instance.new("ScrollingFrame")
local UICorner = Instance.new("UICorner")
local UICorner_2 = Instance.new("UICorner")
local TextName = Instance.new("TextLabel")
local UIListLayout = Instance.new("UIListLayout")
--Properties:
DogeHubGUI.Name = "DogeHubGUI"
DogeHubGUI.Parent = game.CoreGui
Main.Name = "Main"
Main.Parent = DogeHubGUI
Main.BackgroundColor3 = Color3.fromRGB(44, 44, 44)
Main.BackgroundTransparency = 1.000
Main.Position = UDim2.new(0.191394657, 0, 0.0835380852, 0)
Main.Size = UDim2.new(0, 178, 0, 335)
Main.Image = "rbxassetid://3570695787"
Main.ImageColor3 = Color3.fromRGB(44, 44, 44)
Main.ScaleType = Enum.ScaleType.Slice
Main.SliceCenter = Rect.new(100, 100, 100, 100)
Main.SliceScale = 0.250
Main2.Name = "Main2"
Main2.Parent = Main
Main2.Active = true
Main2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
Main2.BackgroundTransparency = 1.000
Main2.BorderSizePixel = 0
Main2.Size = UDim2.new(1, 0, 1, 0)
Main2.CanvasSize = UDim2.new(0, 0, 1.5, 0)
Main2.ScrollBarThickness = 0
UIListLayout.Parent = Main2
UIListLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center
UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
UIListLayout.Padding = UDim.new(0.0500000007, 0)
--Adding Functions
function dog:NewBox(Name, func)
local BoxName = Instance.new("TextBox")
UICorner.Parent = BoxName
BoxName.Name = Name
BoxName.Parent = Main2
BoxName.BackgroundColor3 = Color3.fromRGB(0, 102, 255)
BoxName.Position = UDim2.new(0.139393941, 0, 0.17458123, 0)
BoxName.Size = UDim2.new(0, 130, 0, 45)
BoxName.Font = Enum.Font.SourceSansBold
BoxName.PlaceholderColor3 = Color3.fromRGB(203, 203, 203)
BoxName.PlaceholderText = Name
BoxName.Text = ""
BoxName.TextColor3 = Color3.fromRGB(255, 255, 255)
BoxName.TextScaled = true
BoxName.TextSize = 14.000
BoxName.TextWrapped = true
BoxName.Text.Changed:Connect(func)
end
function dog:NewButton(Name, func)
local ButtonName = Instance.new("TextButton")
UICorner_2.Parent = ButtonName
ButtonName.Name = Name
ButtonName.Parent = Main2
ButtonName.BackgroundColor3 = Color3.fromRGB(0, 102, 255)
ButtonName.Position = UDim2.new(0.139393941, 0, 0.17458123, 0)
ButtonName.Size = UDim2.new(0, 130, 0, 45)
ButtonName.Font = Enum.Font.SourceSansBold
ButtonName.TextColor3 = Color3.fromRGB(255, 255, 255)
ButtonName.TextScaled = true
ButtonName.TextSize = 14.000
ButtonName.TextWrapped = true
ButtonName.Text = Name
ButtonName.MouseButton1Click:Connect(func)
end
function dog:NewText(Text)
TextName.Name = Text
TextName.Parent = Main2
TextName.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
TextName.BackgroundTransparency = 1.000
TextName.Position = UDim2.new(-0.201923072, 0, -0.0577114411, 0)
TextName.Size = UDim2.new(0, 165, 0, 24)
TextName.Font = Enum.Font.SourceSansBold
TextName.Text = Text
TextName.TextColor3 = Color3.fromRGB(255, 255, 255)
TextName.TextScaled = true
TextName.TextSize = 14.000
TextName.TextWrapped = true
end
-- Scripts:
local function PPJKYVM_fake_script() -- Main.OpenCloseScript
local script = Instance.new('LocalScript', Main)
local uis = game:GetService("UserInputService")
local Frame = script.Parent
uis.InputBegan:Connect(function(key, gp)
if key.KeyCode == Enum.KeyCode.Delete then
Frame.Visible = not Frame.Visible
end
end)
end
coroutine.wrap(PPJKYVM_fake_script)()
local function NBXDPZ_fake_script() -- Main.Dragify
local script = Instance.new('LocalScript', Main)
local UIS = game:GetService("UserInputService")
function dragify(Frame)
dragToggle = nil
local dragSpeed = 0.50
dragInput = nil
dragStart = nil
local dragPos = nil
function updateInput(input)
local Delta = input.Position - dragStart
local Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + Delta.X, startPos.Y.Scale, startPos.Y.Offset + Delta.Y)
game:GetService("TweenService"):Create(Frame, TweenInfo.new(0.30), {Position = Position}):Play()
end
Frame.InputBegan:Connect(function(input)
if (input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch) and UIS:GetFocusedTextBox() == nil then
dragToggle = true
dragStart = input.Position
startPos = Frame.Position
input.Changed:Connect(function()
if input.UserInputState == Enum.UserInputState.End then
dragToggle = false
end
end)
end
end)
Frame.InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
dragInput = input
end
end)
game:GetService("UserInputService").InputChanged:Connect(function(input)
if input == dragInput and dragToggle then
updateInput(input)
end
end)
end
dragify(script.Parent)
end
coroutine.wrap(NBXDPZ_fake_script)()