forked from Epix-Incorporated/Adonis
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProfile.luau
More file actions
486 lines (444 loc) · 17.2 KB
/
Profile.luau
File metadata and controls
486 lines (444 loc) · 17.2 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
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
local DateTime = DateTime
client, service, Routine = nil, nil, nil
local function boolToStr(bool)
return bool and "Yes" or "No"
end
return function(data, env)
if env then
setfenv(1, env)
end
local client = client
local service = client.Service
local Routine = Routine
local player: Player = data.Target
local window = client.UI.Make("Window", {
Name = `Profile_{player.UserId}`;
Title = `Profile (@{player.Name})`;
Icon = client.MatIcons["Account circle"];
Size = {400, 400};
AllowMultiple = false;
})
local tabFrame = window:Add("TabFrame", {
Size = UDim2.new(1, -10, 1, -10);
Position = UDim2.new(0, 5, 0, 5);
})
local generaltab = tabFrame:NewTab("General", {
Text = "General"
})
local friendstab = tabFrame:NewTab("Friends", {
Text = "Friends"
})
local groupstab = tabFrame:NewTab("Groups", {
Text = "Groups"
})
local gametab = tabFrame:NewTab("Game", {
Text = "Game"
})
local isFriends = player:IsFriendsWith(service.Players.LocalPlayer.UserId)
if player ~= service.Players.LocalPlayer then
window:AddTitleButton({
Text = "";
ToolTip = isFriends and "Unfriend" or "Add friend";
OnClick = isFriends and function()
service.StarterGui:SetCore("PromptUnfriend", player)
end
or function()
service.StarterGui:SetCore("PromptSendFriendRequest", player)
end
}):Add("ImageLabel", {
Size = UDim2.new(0, 20, 0, 20);
Position = UDim2.new(0, 5, 0, 0);
Image = isFriends and client.MatIcons["Person remove"] or client.MatIcons["Person add"];
BackgroundTransparency = 1;
})
end
window:AddTitleButton({
Text = "";
ToolTip = "View avatar";
OnClick = function()
service.GuiService:InspectPlayerFromUserId(player.UserId)
end
}):Add("ImageLabel", {
Size = UDim2.new(0, 18, 0, 18);
Position = UDim2.new(0, 6, 0, 1);
Image = client.MatIcons["Person search"];
BackgroundTransparency = 1;
})
do --// General Tab
generaltab:Add("ImageLabel", {
Size = UDim2.new(0, 120, 0, 120);
Position = UDim2.new(0, 5, 0, 5);
Image = service.Players:GetUserThumbnailAsync(player.UserId, Enum.ThumbnailType.AvatarBust, Enum.ThumbnailSize.Size150x150);
})
for i, v in ipairs({
{"Display Name", player.DisplayName, "The player's custom display name"},
{"Username", player.Name, "The player's unique Roblox username"},
{"User ID", player.UserId, "The player's unique Roblox user ID"},
{"Acc. Age", `{player.AccountAge} days ({string.format("%.2f", player.AccountAge/365.2425)} years)`, "How long the player has been registered on Roblox"},
}) do
generaltab:Add("TextLabel", {
Text = ` {v[1]}: `;
ToolTip = v[3];
BackgroundTransparency = (i%2 == 0 and 0) or 0.2;
Size = UDim2.new(1, -135, 0, 30);
Position = UDim2.new(0, 130, 0, (30*(i-1))+5);
TextXAlignment = "Left";
}):Add("TextBox", {
Text = v[2];
BackgroundTransparency = 1;
Size = UDim2.new(0, 120, 1, 0);
Position = UDim2.new(1, -130, 0, 0);
TextEditable = false;
ClearTextOnFocus = false;
Selectable = true;
TextXAlignment = "Right";
})
end
for i, v in ipairs({
{"Membership", player.MembershipType.Name, "The player's Roblox membership type (Premium)"},
{"Can Chat", data.CanChatGet[1] and boolToStr(data.CanChatGet[2]) or "[Error]", "Does the player's account settings allow them to chat?"},
{"Safe Chat Enabled", data.SafeChat, "[Admins Only] Does the player have safe chat applied?"},
{"Mail Verified", data.MailVerified, "[Admins Only] Does the player have verified their mail?"},
{"Phone/ID Verified", data.IDVerified, "[Admins Only] Does the player have verified their non-VoIP phone / ID?"},
}) do
generaltab:Add("TextLabel", {
Text = ` {v[1]}: `;
ToolTip = v[3];
BackgroundTransparency = (i%2 == 0 and 0) or 0.2;
Size = UDim2.new(1, -10, 0, 30);
Position = UDim2.new(0, 5, 0, (30*(i-1))+130);
TextXAlignment = "Left";
}):Add("TextLabel", {
Text = v[2];
BackgroundTransparency = 1;
Size = UDim2.new(0, 120, 1, 0);
Position = UDim2.new(1, -130, 0, 0);
TextXAlignment = "Right";
})
end
local c = 0
for _, v in ipairs({
{data.IsServerOwner, "Private Server Owner", client.MatIcons.Grade, "User owns the current private server"},
{data.IsDonor, "Adonis Donor", "rbxassetid://6877822142", "User has purchased the Adonis donation pass/shirt"},
{player:GetRankInGroup(886423) == 10, "Adonis Open-Source Contributor", "rbxassetid://6878433601", "User has contributed to the Adonis admin system (see credit list)"},
{player:GetRankInGroup(886423) >= 12, "Adonis Developer", "rbxassetid://6878433601", "User is an official developer of the Adonis admin system (see credit list)"},
{player.UserId == 1237666 or player.UserId == 698712377, "Adonis Creator [Sceleratis/Davey_Bones]", "rbxassetid://6878433601", "You're looking at the creator of the Adonis admin system!"},
{player:IsInGroup(1200769) or player:IsInGroup(2868472), "Roblox Staff", "rbxassetid://6811962259", "User is an official Roblox employee (!)"},
{player:IsInGroup(3514227), "DevForum Member", "rbxassetid://6383940476", "User is a member of the Roblox Developer Forum"},
}) do
if v[1] then
generaltab:Add("TextLabel", {
Size = UDim2.new(1, -10, 0, 30);
Position = UDim2.new(0, 5, 0, 32*c + 285);
BackgroundTransparency = 0.4;
Text = v[2];
ToolTip = v[4];
}):Add("ImageLabel", {
Image = v[3];
BackgroundTransparency = 1;
Size = UDim2.new(0, 24, 0, 24);
Position = UDim2.new(0, 4, 0, 3);
})
c += 1
end
end
generaltab:ResizeCanvas(false, true, false, false, 5, 5)
end
window:Ready()
do --// Friends Tab
local function pagesToTable(pages)
local items = {}
while true do
table.insert(items, pages:GetCurrentPage())
if pages.IsFinished then
break
end
pages:AdvanceToNextPageAsync()
end
return items
end
local function iterPageItems(pages)
local contents = pagesToTable(pages)
local pagenum = 1
local lastpagenum = #contents
return coroutine.wrap(function()
local pagenum = 1
while pagenum <= lastpagenum do
for _, item in ipairs(contents[pagenum]) do
coroutine.yield(item, pagenum)
end
pagenum += 1
end
end)
end
local LOCATION_TYPE = {"Mobile Website", "Mobile In-Game", "Webpage", "Studio", "In-Game", "Xbox", "Team Create"}
local ACTIVITY_COLOR_CODES = {
["Mobile Website"] = Color3.fromRGB(50, 140, 231);
["Mobile In-Game"] = Color3.fromRGB(55, 200, 55);
["Webpage"] = Color3.fromRGB(50, 140, 231);
["Studio"] = Color3.fromRGB(231, 112, 0);
["In-Game"] = Color3.fromRGB(55, 200, 55);
["Xbox"] = Color3.fromRGB(127, 0, 127);
["Team Create"] = Color3.fromRGB(231, 112, 0);
}
local friendPages = service.Players:GetFriendsAsync(player.UserId)
local onlineFriends = {}
local sortedFriends = {}
local friendInfoRef = {}
local friendCount = 0
local onlineCount = 0
if type(data.OnlineFriends) == "table" then
for _, user in pairs(data.OnlineFriends) do
onlineFriends[user.VisitorId] = {
lastOnline = DateTime.fromIsoDate(user.LastOnline),
isOnline = user.IsOnline,
lastLocation = user.LastLocation,
placeId = user.PlaceId,
jobId = user.GameId,
locationType = LOCATION_TYPE[user.LocationType and user.LocationType + 1]
}
end
end
Routine(function()
for item, pageNo in iterPageItems(friendPages) do
table.insert(sortedFriends, item.Username)
local userId = item.Id
local activity = onlineFriends[userId]
friendInfoRef[item.Username] = {
id = userId;
displayName = item.DisplayName;
-- // Activity data
isOnline = activity and activity.isOnline;
lastOnline = activity and activity.lastOnline or DateTime.fromUnixTimestamp(0);
lastLocation = activity and activity.lastLocation;
placeId = activity and activity.placeId;
jobId = activity and activity.jobId;
locationType = activity and activity.locationType;
}
if activity and activity.isOnline then
onlineCount += 1
end
friendCount += 1
end
table.sort(sortedFriends)
local search = friendstab:Add("TextBox", {
Size = UDim2.new(1, -10, 0, 25);
Position = UDim2.new(0, 5, 0, 5);
BackgroundTransparency = 0.5;
PlaceholderText = ("Search %d friends (%d online)"):format(friendCount, onlineCount);
Text = "";
TextStrokeTransparency = 0.8;
})
search:Add("ImageLabel", {
Image = client.MatIcons.Search;
Position = UDim2.new(1, -21, 0, 3);
Size = UDim2.new(0, 18, 0, 18);
ImageTransparency = 0.2;
BackgroundTransparency = 1;
})
local scroller = friendstab:Add("ScrollingFrame",{
List = {};
ScrollBarThickness = 2;
BackgroundTransparency = 1;
Position = UDim2.new(0, 5, 0, 35);
Size = UDim2.new(1, -10, 1, -40);
})
local function getList()
scroller:ClearAllChildren()
local i = 1
for _, friendName in ipairs(sortedFriends) do
local friendInfo = friendInfoRef[friendName]
if (friendName:sub(1, #search.Text):lower() == search.Text:lower()) or (friendInfo.displayName:sub(1, #search.Text):lower() == search.Text:lower()) then
local entryText = ""
if friendName == friendInfo.displayName then
entryText = friendName
else
entryText = `{friendInfo.displayName} (@{friendName})`
end
local entry = scroller:Add("TextLabel", {
Text = ` {entryText}`;
ToolTip = `User ID: {friendInfo.id}`;
BackgroundTransparency = ((i-1)%2 == 0 and 0) or 0.2;
Size = UDim2.new(1, 0, 0, 30);
Position = UDim2.new(0, 0, 0, (30*(i-1)));
TextXAlignment = "Left";
})
entry:Add("TextLabel", { -- TODO: Add support for joining
Text = friendInfo.locationType or "Offline";
ToolTip = friendInfo.placeId and `Playing {friendInfo.placeId} - (friendInfo.lastLocation)` or `Last online {friendInfo.lastOnline:FormatLocalTime("LLLL", service.GetCurrentLocale())}`;
BackgroundTransparency = 1;
TextColor3 = ACTIVITY_COLOR_CODES[friendInfo.locationType] or Color3.fromRGB(127, 127, 127);
Size = UDim2.new(0, 120, 1, 0);
Position = UDim2.new(1, -130, 0, 0);
TextXAlignment = "Right";
})
Routine(function()
entry:Add("ImageLabel", {
Image = service.Players:GetUserThumbnailAsync(friendInfo.id, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size48x48);
BackgroundTransparency = 1;
Size = UDim2.new(0, 30, 0, 30);
Position = UDim2.new(0, 0, 0, 0);
})
end)
i += 1
end
end
scroller:ResizeCanvas(false, true, false, false, 5, 5)
end
search:GetPropertyChangedSignal("Text"):Connect(getList)
getList()
end)
end
do --// Groups Tab
local sortedGroups = {}
local groupInfoRef = {}
local groupCount = 0
local ownCount = 0
for _, groupInfo in pairs(service.GroupService:GetGroupsAsync(player.UserId) or {}) do
Routine(service.ContentProvider.PreloadAsync, service.ContentProvider, {
groupInfo.EmblemUrl
})
table.insert(sortedGroups, groupInfo.Name)
groupInfoRef[groupInfo.Name] = groupInfo
groupCount += 1
if groupInfo.Rank == 255 then
ownCount += 1
end
end
table.sort(sortedGroups)
local search = groupstab:Add("TextBox", {
Size = UDim2.new(1, -10, 0, 25);
Position = UDim2.new(0, 5, 0, 5);
BackgroundTransparency = 0.5;
PlaceholderText = ("Search %d group%s (%d owned)"):format(groupCount, groupCount ~= 1 and "s" or "", ownCount);
Text = "";
TextStrokeTransparency = 0.8;
})
search:Add("ImageLabel", {
Image = client.MatIcons.Search;
Position = UDim2.new(1, -21, 0, 3);
Size = UDim2.new(0, 18, 0, 18);
ImageTransparency = 0.2;
BackgroundTransparency = 1;
})
local scroller = groupstab:Add("ScrollingFrame",{
List = {};
ScrollBarThickness = 2;
BackgroundTransparency = 1;
Position = UDim2.new(0, 5, 0, 35);
Size = UDim2.new(1, -10, 1, -40);
})
local function getList()
scroller:ClearAllChildren()
local i = 1
for _, groupName in ipairs(sortedGroups) do
local groupInfo = groupInfoRef[groupName]
if (groupName:sub(1, #search.Text):lower() == search.Text:lower()) or (groupInfo.Role:sub(1, #search.Text):lower() == search.Text:lower()) then
local entry = scroller:Add("TextLabel", {
Text = "";
ToolTip = string.format("%sID: %d | Rank: %d%s", groupInfo.IsPrimary and "Primary Group | " or "", groupInfo.Id, groupInfo.Rank, groupInfo.Rank == 255 and " (Owner)" or "");
BackgroundTransparency = ((i-1)%2 == 0 and 0) or 0.2;
Size = UDim2.new(1, -10, 0, 30);
Position = UDim2.new(0, 5, 0, (30*(i-1)));
TextXAlignment = "Left";
})
local rankLabel = entry:Add("TextLabel", {
Text = groupInfo.Role;
BackgroundTransparency = 1;
Size = UDim2.new(0, 0, 1, 0);
Position = UDim2.new(1, -10, 0, 0);
ClipsDescendants = false;
TextXAlignment = "Right";
})
local groupLabel = entry:Add("TextLabel", {
Text = groupName;
BackgroundTransparency = 1;
Size = UDim2.new(1, -50-rankLabel.TextBounds.X, 1, 0);
Position = UDim2.new(0, 36, 0, 0);
TextXAlignment = "Left";
TextTruncate = "AtEnd";
})
if groupInfo.IsPrimary and groupInfo.Rank >= 255 then
groupLabel.TextColor3 = Color3.fromRGB(85, 255, 127)
elseif groupInfo.IsPrimary then
groupLabel.TextColor3 = Color3.fromRGB(170, 255, 255)
elseif groupInfo.Rank >= 255 then
groupLabel.TextColor3 = Color3.new(1, 1, 0.5)
end
Routine(function()
entry:Add("ImageLabel", {
Image = groupInfo.EmblemUrl;
BackgroundTransparency = 1;
Size = UDim2.new(0, 30, 0, 30);
Position = UDim2.new(0, 0, 0, 0);
})
end)
i += 1
end
end
scroller:ResizeCanvas(false, true, false, false, 5, 5)
end
search:GetPropertyChangedSignal("Text"):Connect(getList)
getList()
end
if data.GameData then --// Game Tab
local gameplayDataToDisplay = {
{"Admin Level", data.GameData.AdminLevel, "The player's Adonis rank"},
{"Muted", boolToStr(data.GameData.IsMuted), "Is the player muted? (IGNORES TRELLO MUTELIST)"},
{"Auto Jump Enabled", boolToStr(player.AutoJumpEnabled), "Does the player have auto jump enabled?"},
{"Camera Max Zoom Distance", player.CameraMaxZoomDistance, "How far in studs the player can zoom out their camera"},
{"Camera Min Zoom Distance", player.CameraMinZoomDistance, "How close in studs the player can zoom in their camera"},
-- NEEDS REFRESHABILITY {"Gameplay Paused", boolToStr(player.GameplayPaused), "Is the player's gameplay paused? (for content streaming)"},
-- NEEDS REFRESHABILITY {"Character Exists", boolToStr(player.Character), "Does the player currently have a character?"},
{"Accelerometer Enabled", boolToStr(data.GameData.AccelerometerEnabled), "Whether the user’s device has an accelerometer"},
{"Gamepad Enabled", boolToStr(data.GameData.GamepadEnabled), "Whether the user's device has an available gamepad"},
{"Gyroscope Enabled", boolToStr(data.GameData.GyroscopeEnabled), "Whether the user’s device has a gyroscope"},
{"Keyboard Enabled", boolToStr(data.GameData.KeyboardEnabled), "Whether the user’s device has a keyboard available"},
{"Mouse Delta Sensitivity", data.GameData.MouseDeltaSensitivity, "The scale of the delta (change) output of the user’s Mouse"},
{"Mouse Enabled", boolToStr(data.GameData.MouseEnabled), "Whether the user’s device has a mouse available"},
-- NEEDS REFRESHABILITY {"OnScreenKeyboardVisible", data.GameData.OnScreenKeyboardVisible, "Whether an on-screen keyboard is currently visible on the user’s screen"},
{"Render Resolution", data.GameData.Resolution, "The render resolution on user's current device. May not reflect real resolution on high-DPI devices."},
{"Touch Enabled", boolToStr(data.GameData.TouchEnabled), "Whether the user’s current device has a touch-screen available"},
{"VR Enabled", boolToStr(data.GameData.VREnabled), "Whether the user is using a virtual reality headset"},
{"Source Place ID", data.GameData.SourcePlaceId, "The ID of the place from which the player was teleported to this game, if applicable"},
}
local i = 1
for _, v in ipairs(gameplayDataToDisplay) do
local entry = gametab:Add("TextLabel", {
Text = ` {v[1]}: `;
ToolTip = v[3];
BackgroundTransparency = i%2 == 0 and 0 or 0.2;
Size = UDim2.new(1, -10, 0, 25);
Position = UDim2.new(0, 5, 0, 25*(i-1) + 5);
TextXAlignment = "Left";
}):Add("TextLabel", {
Text = v[2];
BackgroundTransparency = 1;
Size = UDim2.new(0, 120, 1, 0);
Position = UDim2.new(1, -130, 0, 0);
TextXAlignment = "Right";
})
i += 1
end
gametab:Add("TextButton", {
Text = "View Tools";
ToolTip = string.format("%sviewtools%s%s", data.CmdPrefix, data.CmdSplitKey, player.Name);
BackgroundTransparency = (i%2 == 0 and 0) or 0.2;
Size = UDim2.new(1, -10, 0, 30);
Position = UDim2.new(0, 5, 0, 25*(i-1) + 10);
OnClicked = function(self)
if self.Active then
self.Active = false
self.AutoButtonColor = false
client.Remote.Send("ProcessCommand", string.format("%sviewtools%s%s", data.CmdPrefix, data.CmdSplitKey, player.Name))
task.wait(2)
self.AutoButtonColor = true
self.Active = true
end
end
})
gametab:ResizeCanvas(false, true, false, false, 5, 5)
else
gametab:Disable()
end
end