-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMath-Murder.lua
More file actions
273 lines (231 loc) · 8.5 KB
/
Math-Murder.lua
File metadata and controls
273 lines (231 loc) · 8.5 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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local player = Players.LocalPlayer
local workspace = game:GetService("Workspace")
-- Create UI
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "MathSolverUI"
screenGui.ResetOnSpawn = false
screenGui.Parent = player:WaitForChild("PlayerGui")
-- Main Container
local mainContainer = Instance.new("Frame")
mainContainer.Name = "MainContainer"
mainContainer.Size = UDim2.new(0, 180, 0, 85)
mainContainer.Position = UDim2.new(0.5, -90, 0.05, 0)
mainContainer.BackgroundColor3 = Color3.fromRGB(15, 15, 25)
mainContainer.BorderSizePixel = 0
mainContainer.ClipsDescendants = true
mainContainer.Parent = screenGui
local mainCorner = Instance.new("UICorner")
mainCorner.CornerRadius = UDim.new(0, 10)
mainCorner.Parent = mainContainer
-- Animated Border
local border = Instance.new("UIStroke")
border.Color = Color3.fromRGB(138, 43, 226)
border.Thickness = 2
border.Parent = mainContainer
spawn(function()
while true do
RunService.Heartbeat:Wait()
local hue = tick() % 5 / 5
border.Color = Color3.fromHSV(hue, 0.8, 1)
end
end)
-- Header Bar
local headerBar = Instance.new("Frame")
headerBar.Name = "HeaderBar"
headerBar.Size = UDim2.new(1, 0, 0, 30)
headerBar.BackgroundColor3 = Color3.fromRGB(25, 25, 40)
headerBar.BorderSizePixel = 0
headerBar.Parent = mainContainer
local headerCorner = Instance.new("UICorner")
headerCorner.CornerRadius = UDim.new(0, 10)
headerCorner.Parent = headerBar
local headerCover = Instance.new("Frame")
headerCover.Size = UDim2.new(1, 0, 0, 15)
headerCover.Position = UDim2.new(0, 0, 1, -15)
headerCover.BackgroundColor3 = Color3.fromRGB(25, 25, 40)
headerCover.BorderSizePixel = 0
headerCover.Parent = headerBar
-- Title
local titleLabel = Instance.new("TextLabel")
titleLabel.Name = "Title"
titleLabel.Size = UDim2.new(1, -50, 0, 20)
titleLabel.Position = UDim2.new(0, 5, 0, 3)
titleLabel.BackgroundTransparency = 1
titleLabel.Text = "ATG Hub"
titleLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
titleLabel.TextSize = 12
titleLabel.Font = Enum.Font.GothamBold
titleLabel.TextXAlignment = Enum.TextXAlignment.Left
titleLabel.Parent = headerBar
-- Toggle Button
local toggleButton = Instance.new("TextButton")
toggleButton.Name = "ToggleButton"
toggleButton.Size = UDim2.new(0, 45, 0, 22)
toggleButton.Position = UDim2.new(1, -50, 0, 4)
toggleButton.BackgroundColor3 = Color3.fromRGB(46, 204, 113)
toggleButton.BorderSizePixel = 0
toggleButton.Text = "ON"
toggleButton.TextColor3 = Color3.fromRGB(255, 255, 255)
toggleButton.TextSize = 10
toggleButton.Font = Enum.Font.GothamBold
toggleButton.Parent = headerBar
local toggleCorner = Instance.new("UICorner")
toggleCorner.CornerRadius = UDim.new(0, 5)
toggleCorner.Parent = toggleButton
-- Content Frame
local contentFrame = Instance.new("Frame")
contentFrame.Name = "ContentFrame"
contentFrame.Size = UDim2.new(1, -10, 1, -40)
contentFrame.Position = UDim2.new(0, 5, 0, 35)
contentFrame.BackgroundTransparency = 1
contentFrame.Parent = mainContainer
-- Status Label
local statusLabel = Instance.new("TextLabel")
statusLabel.Name = "Status"
statusLabel.Size = UDim2.new(1, 0, 0, 15)
statusLabel.BackgroundTransparency = 1
statusLabel.Text = "⚡ Ready"
statusLabel.TextColor3 = Color3.fromRGB(100, 255, 150)
statusLabel.TextSize = 10
statusLabel.Font = Enum.Font.Gotham
statusLabel.TextXAlignment = Enum.TextXAlignment.Left
statusLabel.Parent = contentFrame
-- Question Label
local questionLabel = Instance.new("TextLabel")
questionLabel.Name = "Question"
questionLabel.Size = UDim2.new(1, 0, 0, 12)
questionLabel.Position = UDim2.new(0, 0, 0, 17)
questionLabel.BackgroundTransparency = 1
questionLabel.Text = "❓ Waiting..."
questionLabel.TextColor3 = Color3.fromRGB(200, 200, 200)
questionLabel.TextSize = 9
questionLabel.Font = Enum.Font.Gotham
questionLabel.TextXAlignment = Enum.TextXAlignment.Left
questionLabel.Parent = contentFrame
-- Answer Label
local answerLabel = Instance.new("TextLabel")
answerLabel.Name = "Answer"
answerLabel.Size = UDim2.new(1, 0, 0, 12)
answerLabel.Position = UDim2.new(0, 0, 0, 31)
answerLabel.BackgroundTransparency = 1
answerLabel.Text = "N/A"
answerLabel.TextColor3 = Color3.fromRGB(100, 255, 150)
answerLabel.TextSize = 9
answerLabel.Font = Enum.Font.GothamBold
answerLabel.TextXAlignment = Enum.TextXAlignment.Left
answerLabel.Parent = contentFrame
-- Drag
local dragging, dragStart, startPos
headerBar.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
dragging = true
dragStart = input.Position
startPos = mainContainer.Position
input.Changed:Connect(function()
if input.UserInputState == Enum.UserInputState.End then
dragging = false
end
end)
end
end)
UserInputService = game:GetService("UserInputService")
UserInputService.InputChanged:Connect(function(input)
if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
local delta = input.Position - dragStart
mainContainer.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
end
end)
-- Toggle
local isEnabled = true
toggleButton.MouseButton1Click:Connect(function()
isEnabled = not isEnabled
if isEnabled then
toggleButton.Text = "ON"
toggleButton.BackgroundColor3 = Color3.fromRGB(46, 204, 113)
else
toggleButton.Text = "OFF"
toggleButton.BackgroundColor3 = Color3.fromRGB(231, 76, 60)
end
end)
-- CACHED PATHS
local screenPath
local questionTextObj
local gameEvent
local lastQuestion = ""
-- SOLVE (INSTANT)
local function solve(q)
local c = q:gsub("%s+", ""):gsub("[xX]", "*")
local e = c:match("(.+)=")
if not e then return nil end
local n1, n2
n1, n2 = e:match("(%d+)/(%d+)")
if n1 then return tostring(math.floor(tonumber(n1) / tonumber(n2))) end
n1, n2 = e:match("(%d+)%*(%d+)")
if n1 then return tostring(tonumber(n1) * tonumber(n2)) end
n1, n2 = e:match("(%d+)%+(%d+)")
if n1 then return tostring(tonumber(n1) + tonumber(n2)) end
n1, n2 = e:match("(%d+)%-(%d+)")
if n1 then return tostring(tonumber(n1) - tonumber(n2)) end
return nil
end
-- HEARTBEAT MONITOR (ULTRA FAST)
RunService.Heartbeat:Connect(function()
if not isEnabled then return end
-- Cache paths once
if not screenPath then
screenPath = workspace:FindFirstChild("Map")
if screenPath then
screenPath = screenPath:FindFirstChild("Functional")
if screenPath then
screenPath = screenPath:FindFirstChild("Screen")
if screenPath then
screenPath = screenPath:FindFirstChild("SurfaceGui")
if screenPath then
screenPath = screenPath:FindFirstChild("MainFrame")
if screenPath then
screenPath = screenPath:FindFirstChild("MainGameContainer")
if screenPath then
screenPath = screenPath:FindFirstChild("MainTxtContainer")
end
end
end
end
end
end
end
if not screenPath then return end
-- Cache question object
if not questionTextObj then
questionTextObj = screenPath:FindFirstChild("QuestionText")
end
if not questionTextObj then return end
local txt = questionTextObj.Text
if txt == "" or txt == lastQuestion then return end
lastQuestion = txt
questionLabel.Text = "❓ " .. (txt:len() > 30 and txt:sub(1, 27) .. "..." or txt)
local ans = solve(txt)
if ans then
answerLabel.Text = "✓ " .. ans
answerLabel.TextColor3 = Color3.fromRGB(100, 255, 150)
statusLabel.Text = "⚡ SUBMIT"
-- Cache event
if not gameEvent then
local evt = ReplicatedStorage:FindFirstChild("Events")
if evt then
gameEvent = evt:FindFirstChild("GameEvent")
end
end
if gameEvent then
gameEvent:FireServer("updateAnswer", ans)
gameEvent:FireServer("submitAnswer", ans)
end
else
answerLabel.Text = "✗ FAIL"
answerLabel.TextColor3 = Color3.fromRGB(255, 100, 100)
statusLabel.Text = "⚠ ERROR"
end
end)
statusLabel.Text = "⚡ SCANNING"