-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserverinfo.lua
More file actions
445 lines (399 loc) · 16 KB
/
serverinfo.lua
File metadata and controls
445 lines (399 loc) · 16 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
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
-- ServerInfo_Expanded_Scrolling_FullContrast.lua (LocalScript)
-- เวอร์ชันแก้ไข: แสดง HWID (ถ้ามีจาก executor) และ Background แยก Layer ไม่กระทบตัวหนังสือ (TextTransparency = 0) ใช้ ScrollingFrame
local Players = game:GetService("Players")
local MarketplaceService = game:GetService("MarketplaceService")
local TweenService = game:GetService("TweenService")
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local player = Players.LocalPlayer
local placeId = game.PlaceId
local jobId = (pcall(function() return game.JobId end) and game.JobId) or "N/A"
local function safeGetProductName(pid)
local ok, info = pcall(function()
return MarketplaceService:GetProductInfo(pid, Enum.InfoType.Asset)
end)
if ok and info and info.Name then
return tostring(info.Name), info
end
return "Unknown", nil
end
local function trySetClipboard(s)
pcall(function() setclipboard(tostring(s)) end)
end
local function tryGetPrivateServerId()
local ok, id = pcall(function() return game.PrivateServerId end)
if ok and id and id ~= "" then return id end
return "N/A"
end
-- ===== HWID / Executor detection =====
-- พยายามเรียก API หลายตัวที่ executor นิยมมีให้ (gethwid, get_hwid, getExecutorHWID, identifyexecutor, getexecutor)
local function getExecutorHWID()
-- คืนค่า: hwid string และ source ชื่อฟังก์ชันที่ใช้ (หรือ nil)
local hwid = nil
local source = nil
-- try common names
local tryFuncs = {
{"gethwid", gethwid},
{"get_hwid", get_hwid},
{"getHWID", getHWID},
{"GetHWID", GetHWID},
-- some executors expose identifyexecutor/getexecutor (identifyexecutor often returns executor name, not hwid)
{"getexecutor", getexecutor},
{"identifyexecutor", identifyexecutor},
}
for _, entry in ipairs(tryFuncs) do
local name, fn = entry[1], entry[2]
if type(fn) == "function" then
local ok, res = pcall(fn)
if ok and res and tostring(res) ~= "" then
-- If the function returns something that looks like an HWID or identifier, keep it.
hwid = tostring(res)
source = name
break
end
end
end
-- some executors may store hwid in globals or files - attempt common global checks
if not hwid then
-- example: some users manually set a global variable
if _G and _G.HWID then
hwid = tostring(_G.HWID)
source = "_G.HWID"
end
end
-- final fallback
if not hwid then
return "UNKNOWN", nil
else
return hwid, source
end
end
-- ========== UI (UiToLua style) ==========
local parentGui = player:WaitForChild("PlayerGui")
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "ServerInfo_UI_Expanded"
screenGui.Parent = parentGui
screenGui.ResetOnSpawn = false
local Frame = Instance.new("Frame")
Frame.Parent = screenGui
Frame.AnchorPoint = Vector2.new(0.5, 0.5)
Frame.Position = UDim2.new(0.5, 0, -0.4, 0)
Frame.Size = UDim2.new(0, 420, 0, 560)
-- Frame acts as container only (transparent) so background/gradient won't affect text
Frame.BackgroundColor3 = Color3.fromRGB(58,58,58)
Frame.BorderSizePixel = 0
Frame.BackgroundTransparency = 1
Frame.ZIndex = 10
-- Background frame (separate layer so gradient/alpha won't affect text)
local bgFrame = Instance.new("Frame", Frame)
bgFrame.Name = "Background"
bgFrame.Size = UDim2.new(1, 0, 1, 0)
bgFrame.Position = UDim2.new(0, 0, 0, 0)
bgFrame.BackgroundColor3 = Color3.fromRGB(58,58,58)
bgFrame.BackgroundTransparency = 0
bgFrame.BorderSizePixel = 0
bgFrame.ZIndex = 5
local bgCorner = Instance.new("UICorner", bgFrame); bgCorner.CornerRadius = UDim.new(0,6)
local bgStroke = Instance.new("UIStroke", bgFrame); bgStroke.Color = Color3.fromRGB(30,30,30); bgStroke.Thickness = 1
local bgGradient = Instance.new("UIGradient", bgFrame)
bgGradient.Color = ColorSequence.new{ ColorSequenceKeypoint.new(0, Color3.fromRGB(60,60,60)), ColorSequenceKeypoint.new(1, Color3.fromRGB(48,48,48)) }
bgGradient.Transparency = NumberSequence.new(0)
-- Title (ensure full contrast, TextTransparency = 0)
local TextLabel = Instance.new("TextLabel", Frame)
TextLabel.Size = UDim2.new(1, -12, 0, 44)
TextLabel.Position = UDim2.new(0, 6, 0, 8)
TextLabel.BackgroundTransparency = 1
TextLabel.Font = Enum.Font.FredokaOne
TextLabel.TextScaled = true
TextLabel.TextColor3 = Color3.fromRGB(255,255,255)
TextLabel.TextTransparency = 0
TextLabel.Text = "Server Info"
TextLabel.TextWrapped = true
TextLabel.ZIndex = 20
local UICorner_1 = Instance.new("UICorner", TextLabel); UICorner_1.CornerRadius = UDim.new(0,4)
local section = Instance.new("Frame", Frame)
section.Name = "section"
section.Position = UDim2.new(0, 6, 0, 60)
section.Size = UDim2.new(1, -12, 1, -68)
section.BackgroundTransparency = 1
section.BorderSizePixel = 0
section.ZIndex = 20
local UIListLayout = Instance.new("UIListLayout", section)
UIListLayout.Padding = UDim.new(0, 6)
UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
-- ScrollingFrame for rows
local rowsContainer = Instance.new("ScrollingFrame", section)
rowsContainer.Name = "RowsScrolling"
rowsContainer.Size = UDim2.new(1, 0, 1, 0)
rowsContainer.Position = UDim2.new(0, 0, 0, 0)
rowsContainer.BackgroundTransparency = 1
rowsContainer.BorderSizePixel = 0
rowsContainer.ScrollBarThickness = 8
rowsContainer.AutomaticCanvasSize = Enum.AutomaticSize.Y
rowsContainer.CanvasSize = UDim2.new(0,0,0,0)
rowsContainer.ZIndex = 21
rowsContainer.VerticalScrollBarInset = Enum.ScrollBarInset.ScrollBar
local rowsLayout = Instance.new("UIListLayout", rowsContainer)
rowsLayout.Padding = UDim.new(0, 6)
rowsLayout.SortOrder = Enum.SortOrder.LayoutOrder
rowsLayout.HorizontalAlignment = Enum.HorizontalAlignment.Left
rowsLayout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
local y = rowsLayout.AbsoluteContentSize.Y
rowsContainer.CanvasSize = UDim2.new(0, 0, 0, y + 12)
end)
-- create row function (ensure TextTransparency = 0 for all text)
local function CreateRow(labelText, defaultValue)
local container = Instance.new("Frame")
container.Size = UDim2.new(1, -12, 0, 28)
container.BackgroundTransparency = 1
container.BorderSizePixel = 0
container.ZIndex = 21
local lbl = Instance.new("TextLabel", container)
lbl.Name = "Label"
lbl.Size = UDim2.new(0, 160, 1, 0)
lbl.Position = UDim2.new(0, 6, 0, 0)
lbl.BackgroundTransparency = 1
lbl.Font = Enum.Font.SourceSans
lbl.TextSize = 14
lbl.TextColor3 = Color3.fromRGB(220,220,220)
lbl.TextTransparency = 0
lbl.Text = labelText
lbl.TextXAlignment = Enum.TextXAlignment.Left
lbl.ZIndex = 22
local val = Instance.new("TextLabel", container)
val.Name = "Value"
val.Size = UDim2.new(1, -230, 1, 0)
val.Position = UDim2.new(0, 172, 0, 0)
val.BackgroundTransparency = 1
val.Font = Enum.Font.SourceSans
val.TextSize = 14
val.TextColor3 = Color3.fromRGB(245,245,245) -- brighter for readability
val.TextTransparency = 0
val.Text = defaultValue or "LOADING"
val.TextXAlignment = Enum.TextXAlignment.Left
val.ZIndex = 22
local copyBtn = Instance.new("TextButton", container)
copyBtn.Name = "CopyBtn"
copyBtn.Size = UDim2.new(0, 64, 0, 20)
copyBtn.Position = UDim2.new(1, -72, 0, 4)
copyBtn.BackgroundColor3 = Color3.fromRGB(50,50,50)
copyBtn.BorderSizePixel = 0
copyBtn.Font = Enum.Font.SourceSans
copyBtn.TextSize = 14
copyBtn.TextColor3 = Color3.fromRGB(255,255,255)
copyBtn.TextTransparency = 0
copyBtn.Text = "Copy"
copyBtn.AutoButtonColor = true
copyBtn.ZIndex = 22
Instance.new("UICorner", copyBtn).CornerRadius = UDim.new(0,4)
return container, lbl, val, copyBtn
end
-- add rows table
local rows = {}
local function addRow(name, default)
local cont, lbl, val, btn = CreateRow(name, default)
cont.Parent = rowsContainer
rows[name] = {container = cont, label = lbl, value = val, copy = btn}
return rows[name]
end
addRow("Job ID", jobId)
addRow("Place ID", tostring(placeId))
addRow("Place Name", "LOADING")
addRow("Creator", "LOADING")
addRow("Universe ID", "N/A")
addRow("Max Players", "LOADING")
addRow("Player Count", "LOADING")
addRow("Server RunTime (DistributedGameTime)", "LOADING")
addRow("Client Uptime", "LOADING")
addRow("Local Player", player.Name)
addRow("Display Name", player.DisplayName or "N/A")
addRow("Player ID", tostring(player.UserId))
addRow("Account Age (days)", tostring(player.AccountAge or "N/A"))
addRow("Appearance ID", "LOADING")
addRow("Character Position", "N/A")
addRow("Humanoid Count (workspace)", "LOADING")
addRow("FPS (client)", "LOADING")
addRow("Lua Memory (KB)", "LOADING")
addRow("Private Server ID", tryGetPrivateServerId())
addRow("GameId", "N/A")
addRow("Platform Info", "LOADING")
addRow("Server Region", "N/A")
addRow("Active Scripts (est.)", "N/A")
addRow("Players (names)", "N/A")
-- <-- เพิ่มแถว HWID (executor) ตรงนี้
addRow("HWID (executor)", "N/A")
-- Close button (ensure visible text)
local CloseBtn = Instance.new("TextButton", Frame)
CloseBtn.Name = "Close"
CloseBtn.Size = UDim2.new(0, 30, 0, 26)
CloseBtn.Position = UDim2.new(1, -40, 0, 10)
CloseBtn.BackgroundColor3 = Color3.fromRGB(45,45,45)
CloseBtn.BorderSizePixel = 0
CloseBtn.Font = Enum.Font.SourceSans
CloseBtn.Text = "x"
CloseBtn.TextSize = 18
CloseBtn.TextColor3 = Color3.fromRGB(245,245,245)
CloseBtn.TextTransparency = 0
CloseBtn.ZIndex = 30
Instance.new("UICorner", CloseBtn).CornerRadius = UDim.new(0,4)
-- Dragging (จาก Title)
do
local dragging = false
local dragStart = Vector2.new()
local startPos = UDim2.new()
TextLabel.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
dragging = true
dragStart = input.Position
startPos = Frame.Position
input.Changed:Connect(function()
if input.UserInputState == Enum.UserInputState.End then dragging = false end
end)
end
end)
UserInputService.InputChanged:Connect(function(input)
if dragging and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then
local delta = input.Position - dragStart
Frame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
end
end)
end
-- Entrance tween
local entrancePos = UDim2.new(0.5, 0, 0.45, 0)
TweenService:Create(Frame, TweenInfo.new(0.45, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Position = entrancePos}):Play()
-- Close behavior
CloseBtn.MouseButton1Click:Connect(function()
local t = TweenService:Create(Frame, TweenInfo.new(0.35, Enum.EasingStyle.Quad, Enum.EasingDirection.In), {Position = UDim2.new(0.5, 0, -0.6, 0)})
t:Play()
t.Completed:Wait()
pcall(function() screenGui:Destroy() end)
end)
-- Copy handlers + toast (toast anchored to bottom center of Frame) - toast text also full opacity
for name, obj in pairs(rows) do
obj.copy.MouseButton1Click:Connect(function()
local txt = obj.value.Text or ""
trySetClipboard(txt)
local toast = Instance.new("TextLabel", Frame)
toast.Size = UDim2.new(0, 220, 0, 26)
toast.Position = UDim2.new(0.5, -110, 1, -36)
toast.BackgroundColor3 = Color3.fromRGB(10,10,10)
toast.TextColor3 = Color3.fromRGB(245,245,245)
toast.Font = Enum.Font.SourceSans
toast.TextSize = 14
toast.TextTransparency = 0
toast.Text = "Copied: " .. (string.sub(tostring(txt),1,80))
toast.ZIndex = 80
toast.BackgroundTransparency = 0.6
local tinfo = TweenInfo.new(0.35)
TweenService:Create(toast, tinfo, {BackgroundTransparency = 0.3}):Play()
delay(1.1, function()
TweenService:Create(toast, TweenInfo.new(0.35), {BackgroundTransparency = 1, TextTransparency = 1}):Play()
wait(0.45)
pcall(function() toast:Destroy() end)
end)
end)
end
-- Populate static info
rows["Place ID"].value.Text = tostring(placeId)
rows["Job ID"].value.Text = tostring(jobId)
rows["Max Players"].value.Text = tostring(Players.MaxPlayers) .. " Players Max"
rows["Player ID"].value.Text = tostring(player.UserId)
rows["Local Player"].value.Text = tostring(player.Name)
rows["Display Name"].value.Text = tostring(player.DisplayName or "N/A")
rows["Account Age (days)"].value.Text = tostring(player.AccountAge or "N/A")
rows["Appearance ID"].value.Text = (pcall(function() return player.CharacterAppearanceId end) and tostring(player.CharacterAppearanceId)) or "N/A"
rows["Private Server ID"].value.Text = tryGetPrivateServerId()
-- platform info
local platformDetails = {}
pcall(function()
table.insert(platformDetails, "Touch:" .. tostring(UserInputService.TouchEnabled))
table.insert(platformDetails, "Gamepad:" .. tostring(UserInputService.GamepadEnabled))
table.insert(platformDetails, "Keyboard:" .. tostring(UserInputService.KeyboardEnabled))
table.insert(platformDetails, "Platform:" .. tostring(UserInputService:GetPlatform()))
end)
rows["Platform Info"].value.Text = table.concat(platformDetails, " | ")
-- Try product info
spawn(function()
local pname, pinfo = safeGetProductName(placeId)
rows["Place Name"].value.Text = pname
if pinfo and pinfo.Creator then
rows["Creator"].value.Text = tostring(pinfo.Creator.Name or "Unknown")
rows["Universe ID"].value.Text = tostring(pinfo.UniverseId or "N/A")
rows["GameId"].value.Text = tostring(pinfo.GameId or "N/A")
end
end)
-- Runtime measurements
local startTick = tick()
local fpsSamples = {}
local fpsAvg = 0
local heartbeatConn
heartbeatConn = RunService.RenderStepped:Connect(function(dt)
local fps = 1 / (dt > 0 and dt or 0.016)
table.insert(fpsSamples, fps)
if #fpsSamples > 60 then table.remove(fpsSamples, 1) end
local sum = 0
for _,v in ipairs(fpsSamples) do sum = sum + v end
fpsAvg = (#fpsSamples>0) and (sum / #fpsSamples) or 0
end)
-- update loop
spawn(function()
-- initial HWID set (try once at start)
local hwidVal, hwidSource = getExecutorHWID()
if hwidVal and hwidVal ~= "UNKNOWN" then
if hwidSource then
rows["HWID (executor)"].value.Text = tostring(hwidVal) .. " (src: " .. tostring(hwidSource) .. ")"
else
rows["HWID (executor)"].value.Text = tostring(hwidVal)
end
else
rows["HWID (executor)"].value.Text = "N/A"
end
while screenGui and screenGui.Parent do
local count = #Players:GetPlayers()
rows["Player Count"].value.Text = tostring(count) .. " Player(s)"
local serverDT = "N/A"
pcall(function() serverDT = workspace and workspace.DistributedGameTime and workspace.DistributedGameTime or serverDT end)
rows["Server RunTime (DistributedGameTime)"].value.Text = tostring(math.floor(serverDT)) .. "s"
local run = tick() - startTick
local hrs = math.floor(run/3600); local mins = math.floor((run%3600)/60); local secs = math.floor(run%60)
if hrs>0 then rows["Client Uptime"].value.Text = string.format("%d H, %02d M, %02d S", hrs, mins, secs)
elseif mins>0 then rows["Client Uptime"].value.Text = string.format("%d M, %02d S", mins, secs)
else rows["Client Uptime"].value.Text = string.format("%d S", secs) end
-- character pos + humanoid count
local charPos = "N/A"; local humanoidCount = 0
pcall(function()
for _,plr in pairs(Players:GetPlayers()) do
if plr.Character and plr.Character:FindFirstChildOfClass("Humanoid") then
humanoidCount = humanoidCount + 1
end
end
local c = player.Character
if c and c:FindFirstChild("HumanoidRootPart") then
local hrp = c.HumanoidRootPart
charPos = string.format("X:%.1f Y:%.1f Z:%.1f", hrp.Position.X, hrp.Position.Y, hrp.Position.Z)
end
end)
rows["Character Position"].value.Text = charPos
rows["Humanoid Count (workspace)"].value.Text = tostring(humanoidCount)
rows["FPS (client)"].value.Text = tostring(math.floor(fpsAvg)) .. " FPS"
local mem = "N/A"
local ok, c = pcall(function() return collectgarbage and collectgarbage("count") end)
if ok and c then mem = tostring(math.floor(c)) .. " KB" end
rows["Lua Memory (KB)"].value.Text = mem
-- players (names) short list
local names = {}
for i,plr in ipairs(Players:GetPlayers()) do
table.insert(names, plr.Name)
if i >= 8 then break end
end
rows["Players (names)"].value.Text = table.concat(names, ", ")
wait(1)
end
end)
-- cleanup
screenGui.AncestryChanged:Connect(function(_, parent)
if not parent then
if heartbeatConn then heartbeatConn:Disconnect() end
end
end)
-- End of script