Repository navigation
Expand file tree
/
Copy pathrochaface.lua
More file actions
225 lines (182 loc) · 8.98 KB
/
Copy pathrochaface.lua
File metadata and controls
225 lines (182 loc) · 8.98 KB
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
-- HigorGUI Final - Baseado no VapeV4
local HigorGUI = {}
HigorGUI.__index = HigorGUI
local inputService = game:GetService("UserInputService")
local guiService = game:GetService("GuiService")
function HigorGUI.new(config)
local self = setmetatable({}, HigorGUI)
self.Title = config.Title or "HigorGUI"
self.ToggleKey = config.ToggleKey or Enum.KeyCode.G
self.Windows = {}
self.SavedPositions = {}
self.Scale = 1
self:Init()
return self
end
function HigorGUI:Init()
local player = game.Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")
self.ScreenGui = Instance.new("ScreenGui")
self.ScreenGui.Name = "HigorGUI"
self.ScreenGui.ResetOnSpawn = false
self.ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
self.ScreenGui.Parent = playerGui
self:SetupInput()
end
function HigorGUI:CreateWindow(title, x, y, width, height)
local windowFrame = Instance.new("Frame")
windowFrame.Name = title
windowFrame.Size = UDim2.new(0, width, 0, height)
windowFrame.Position = UDim2.new(0, x, 0, y)
windowFrame.BackgroundColor3 = Color3.fromRGB(20, 20, 35)
windowFrame.BorderColor3 = Color3.fromRGB(157, 78, 221)
windowFrame.BorderSizePixel = 2
windowFrame.Parent = self.ScreenGui
self.SavedPositions[title] = {x = x, y = y}
local titleBar = Instance.new("Frame")
titleBar.Name = "TitleBar"
titleBar.Size = UDim2.new(1, 0, 0, 25)
titleBar.BackgroundColor3 = Color3.fromRGB(157, 78, 221)
titleBar.BorderSizePixel = 0
titleBar.Parent = windowFrame
local titleText = Instance.new("TextLabel")
titleText.Text = title:upper()
titleText.Size = UDim2.new(1, 0, 1, 0)
titleText.BackgroundTransparency = 1
titleText.TextColor3 = Color3.fromRGB(255, 255, 255)
titleText.TextSize = 12
titleText.Font = Enum.Font.GothamBold
titleText.TextXAlignment = Enum.TextXAlignment.Center
titleText.Parent = titleBar
local contentFrame = Instance.new("Frame")
contentFrame.Name = "Content"
contentFrame.Size = UDim2.new(1, 0, 1, -25)
contentFrame.Position = UDim2.new(0, 0, 0, 25)
contentFrame.BackgroundTransparency = 1
contentFrame.BorderSizePixel = 0
contentFrame.Parent = windowFrame
self:SetupDrag(windowFrame)
local windowData = {
Frame = windowFrame,
TitleBar = titleBar,
Content = contentFrame,
Modules = {},
Title = title,
ModuleCount = 0
}
table.insert(self.Windows, windowData)
return windowData
end
function HigorGUI:AddToggle(window, name, default, callback)
local toggleFrame = Instance.new("Frame")
toggleFrame.Name = name
toggleFrame.Size = UDim2.new(1, -4, 0, 22)
toggleFrame.Position = UDim2.new(0, 2, 0, window.ModuleCount * 24)
toggleFrame.BackgroundColor3 = Color3.fromRGB(30, 30, 45)
toggleFrame.BorderColor3 = Color3.fromRGB(100, 100, 120)
toggleFrame.BorderSizePixel = 1
toggleFrame.Parent = window.Content
local label = Instance.new("TextLabel")
label.Text = name
label.Size = UDim2.new(0.55, 0, 1, 0)
label.BackgroundTransparency = 1
label.TextColor3 = Color3.fromRGB(200, 200, 200)
label.TextSize = 10
label.Font = Enum.Font.Gotham
label.TextXAlignment = Enum.TextXAlignment.Left
label.Parent = toggleFrame
local toggleBtn = Instance.new("TextButton")
toggleBtn.Name = "Toggle"
toggleBtn.Text = default and "ON" or "OFF"
toggleBtn.Size = UDim2.new(0.45, -2, 1, -2)
toggleBtn.Position = UDim2.new(0.55, 2, 0, 1)
toggleBtn.BackgroundColor3 = default and Color3.fromRGB(0, 180, 100) or Color3.fromRGB(200, 50, 50)
toggleBtn.BorderSizePixel = 0
toggleBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
toggleBtn.TextSize = 9
toggleBtn.Font = Enum.Font.GothamBold
toggleBtn.Parent = toggleFrame
local state = default
toggleBtn.MouseButton1Click:Connect(function()
state = not state
toggleBtn.Text = state and "ON" or "OFF"
toggleBtn.BackgroundColor3 = state and Color3.fromRGB(0, 180, 100) or Color3.fromRGB(200, 50, 50)
if callback then callback(state) end
end)
toggleBtn.MouseEnter:Connect(function()
toggleBtn.BackgroundColor3 = state and Color3.fromRGB(0, 200, 120) or Color3.fromRGB(220, 70, 70)
end)
toggleBtn.MouseLeave:Connect(function()
toggleBtn.BackgroundColor3 = state and Color3.fromRGB(0, 180, 100) or Color3.fromRGB(200, 50, 50)
end)
window.ModuleCount = window.ModuleCount + 1
local newHeight = 25 + (window.ModuleCount * 24)
window.Frame.Size = UDim2.new(0, window.Frame.Size.X.Offset, 0, newHeight)
table.insert(window.Modules, toggleFrame)
end
function HigorGUI:AddButton(window, name, callback)
local btnFrame = Instance.new("Frame")
btnFrame.Name = name
btnFrame.Size = UDim2.new(1, -4, 0, 22)
btnFrame.Position = UDim2.new(0, 2, 0, window.ModuleCount * 24)
btnFrame.BackgroundColor3 = Color3.fromRGB(30, 30, 45)
btnFrame.BorderColor3 = Color3.fromRGB(100, 100, 120)
btnFrame.BorderSizePixel = 1
btnFrame.Parent = window.Content
local btn = Instance.new("TextButton")
btn.Text = name
btn.Size = UDim2.new(1, -2, 1, -2)
btn.Position = UDim2.new(0, 1, 0, 1)
btn.BackgroundColor3 = Color3.fromRGB(30, 30, 45)
btn.BorderSizePixel = 0
btn.TextColor3 = Color3.fromRGB(200, 200, 200)
btn.TextSize = 10
btn.Font = Enum.Font.Gotham
btn.Parent = btnFrame
btn.MouseEnter:Connect(function()
btn.BackgroundColor3 = Color3.fromRGB(50, 50, 70)
end)
btn.MouseLeave:Connect(function()
btn.BackgroundColor3 = Color3.fromRGB(30, 30, 45)
end)
btn.MouseButton1Click:Connect(function()
btn.BackgroundColor3 = Color3.fromRGB(157, 78, 221)
if callback then callback() end
task.wait(0.1)
btn.BackgroundColor3 = Color3.fromRGB(50, 50, 70)
end)
window.ModuleCount = window.ModuleCount + 1
local newHeight = 25 + (window.ModuleCount * 24)
window.Frame.Size = UDim2.new(0, window.Frame.Size.X.Offset, 0, newHeight)
table.insert(window.Modules, btnFrame)
end
function HigorGUI:SetupDrag(gui)
local self = self
inputService.InputBegan:Connect(function(inputObj, gameProcessed)
if gameProcessed then return end
if (inputObj.UserInputType == Enum.UserInputType.MouseButton1 or inputObj.UserInputType == Enum.UserInputType.Touch) then
local mousePos = inputObj.Position
local guiPos = gui.AbsolutePosition
local guiSize = gui.AbsoluteSize
-- Verificar se clicou na barra de título
if mousePos.Y >= guiPos.Y and mousePos.Y <= guiPos.Y + 25 and
mousePos.X >= guiPos.X and mousePos.X <= guiPos.X + guiSize.X then
local dragPosition = Vector2.new(
guiPos.X - mousePos.X,
guiPos.Y - mousePos.Y + guiService:GetGuiInset().Y
) / self.Scale
local changed = inputService.InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement then
local position = input.Position
gui.Position = UDim2.fromOffset(
(position.X / self.Scale) + dragPosition.X,
(position.Y / self.Scale) + dragPosition.Y
)
end
end)
local ended
ended = inputObj.Changed:Connect(function()
if inputObj.UserInputState == Enum.UserInputState.End then
if changed then changed:Disconnect() end
if ended then ended:Disconnect() end
self.SavedPositions[gui.Name] = {\n x = gui.Position.X.Offset,\n y = gui.Position.Y.Offset\n }\n end\n end)\n end\n end\n end)\nend\n\nfunction HigorGUI:SetupInput()\n inputService.InputBegan:Connect(function(input, gameProcessed)\n if gameProcessed then return end\n if input.KeyCode == self.ToggleKey then\n for _, window in ipairs(self.Windows) do\n window.Frame.Visible = not window.Frame.Visible\n \n if window.Frame.Visible and self.SavedPositions[window.Title] then\n local pos = self.SavedPositions[window.Title]\n window.Frame.Position = UDim2.new(0, pos.x, 0, pos.y)\n end\n end\n end\n end)\nend\n\nreturn HigorGUI