-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAnimation Logger.lua
More file actions
246 lines (209 loc) · 8.57 KB
/
Copy pathAnimation Logger.lua
File metadata and controls
246 lines (209 loc) · 8.57 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
game:GetService("StarterGui"):SetCore("SendNotification", {
Title = "Thx for using",
Text = "Made by AOC",
Duration = 15,
Icon = "rbxassetid://16730731897"
})
local gui = Instance.new("ScreenGui")
gui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
local frame = Instance.new("Frame")
frame.Size = UDim2.new(0.315, 0, 0.4, 0)
frame.Position = UDim2.new(0.350, 0, 0.3, 0)
frame.BackgroundColor3 = Color3.new(0, 0, 0)
frame.BorderSizePixel = 0
frame.Parent = gui
frame.Draggable = true
frame.Active = true
local topBar = Instance.new("Frame")
topBar.Size = UDim2.new(1.0017, 0, 0, 30)
topBar.BackgroundColor3 = Color3.new(0.3, 0.3, 0.3)
topBar.BorderSizePixel = 0
topBar.Parent = frame
local titleLabel = Instance.new("TextLabel")
titleLabel.Size = UDim2.new(1, -365, 1, 0)
titleLabel.Position = UDim2.new(0.4, 0, 0, 0)
titleLabel.BackgroundTransparency = 1
titleLabel.Text = "Animation Logger"
titleLabel.Font = Enum.Font.SourceSans
titleLabel.TextColor3 = Color3.new(1, 1, 1)
titleLabel.TextSize = 20
titleLabel.Parent = topBar
local scrollFrame = Instance.new("ScrollingFrame")
scrollFrame.Size = UDim2.new(1, 0, 1, -30)
scrollFrame.Position = UDim2.new(0, 0, 0, 30)
scrollFrame.CanvasSize = UDim2.new(0, 0, 0, 0)
scrollFrame.ScrollBarThickness = 10
scrollFrame.Parent = frame
scrollFrame.BackgroundColor3 = Color3.new(0.1, 0.1, 0.1)
local logLayout = Instance.new("UIListLayout")
logLayout.Parent = scrollFrame
logLayout.SortOrder = Enum.SortOrder.LayoutOrder
local loggedAnimations = {}
local isCopyingAsLinkEnabled = false
local originalColor = Color3.new(0.2, 0.2, 0.2)
local toggleColor = Color3.new(0, 1, 0)
local function logAnimation(animationName, animationId)
if loggedAnimations[animationId] then
return
end
loggedAnimations[animationId] = true
local numericId = tonumber(animationId:match("%d+"))
local logEntry = Instance.new("TextButton")
logEntry.Size = UDim2.new(1, -10, 0, 60)
logEntry.BackgroundColor3 = originalColor
local linkStatus = isCopyingAsLinkEnabled and "Enabled" or "Disabled"
logEntry.Text = string.format("%s\nAnimation ID: %d\nCopy as link: %s", animationName, numericId, linkStatus)
logEntry.TextWrapped = true
logEntry.Font = Enum.Font.SourceSans
logEntry.TextColor3 = Color3.new(1, 1, 1)
logEntry.TextSize = 22
logEntry.Parent = scrollFrame
logEntry.MouseButton1Click:Connect(function()
if isCopyingAsLinkEnabled then
local link = "https://www.roblox.com/library/" .. numericId
setclipboard(link)
else
setclipboard(tostring(numericId))
end
end)
scrollFrame.CanvasSize = UDim2.new(0, 0, 0, logLayout.AbsoluteContentSize.Y)
end
logLayout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
scrollFrame.CanvasSize = UDim2.new(0, 0, 0, logLayout.AbsoluteContentSize.Y)
end)
local function onAnimationPlayed(animationTrack)
local animation = animationTrack.Animation
if animation then
local animationId = animation.AnimationId
local animationName = animation.Name or "Unknown Animation"
logAnimation(animationName, animationId, isCopyingAsLinkEnabled)
end
end
local function trackPlayerAnimations()
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
humanoid.AnimationPlayed:Connect(onAnimationPlayed)
end
trackPlayerAnimations()
local xButton = Instance.new("TextButton")
xButton.Size = UDim2.new(0, 30, 0, 30)
xButton.Position = UDim2.new(1, -30, 0, 0)
xButton.BackgroundColor3 = Color3.new(1, 0, 0)
xButton.Text = "X"
xButton.TextColor3 = Color3.new(1, 1, 1)
xButton.TextSize = 24
xButton.Font = Enum.Font.SourceSans
xButton.BackgroundTransparency = 1
xButton.Parent = topBar
xButton.MouseButton1Click:Connect(function()
gui:Destroy()
end)
local minimizeButton = Instance.new("TextButton")
minimizeButton.Size = UDim2.new(0, 30, 0, 30)
minimizeButton.Position = UDim2.new(1, -60, 0, 0)
minimizeButton.BackgroundColor3 = Color3.new(0, 0, 1)
minimizeButton.Text = "-"
minimizeButton.TextColor3 = Color3.new(1, 1, 1)
minimizeButton.TextSize = 24
minimizeButton.Font = Enum.Font.SourceSans
minimizeButton.BackgroundTransparency = 1
minimizeButton.Parent = topBar
local additionalGUI = Instance.new("Frame")
additionalGUI.Size = UDim2.new(0.5, 0, 1, 0)
additionalGUI.Position = UDim2.new(-0.53, 0, 0, 0)
additionalGUI.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
additionalGUI.BorderSizePixel = 0
additionalGUI.Visible = false
additionalGUI.Parent = frame
local settingsTopBar = Instance.new("Frame")
settingsTopBar.Size = UDim2.new(1, 0, 0, 30)
settingsTopBar.BackgroundColor3 = Color3.new(0.3, 0.3, 0.3)
settingsTopBar.BorderSizePixel = 0
settingsTopBar.Parent = additionalGUI
local settingsLabel = Instance.new("TextLabel")
settingsLabel.Size = UDim2.new(1, 0, 0, 30)
settingsLabel.Position = UDim2.new(0, 0, 0, 0)
settingsLabel.BackgroundTransparency = 1
settingsLabel.Text = "Settings"
settingsLabel.Font = Enum.Font.SourceSans
settingsLabel.TextColor3 = Color3.new(1, 1, 1)
settingsLabel.TextSize = 20
settingsLabel.Parent = additionalGUI
local clearButton = Instance.new("TextButton")
clearButton.Size = UDim2.new(0.95, 0, 0, 30)
clearButton.Position = UDim2.new(0.023, 0, 0, 40)
clearButton.BackgroundColor3 = Color3.new(0.2, 0.2, 0.2)
clearButton.Text = "Clear All"
clearButton.TextColor3 = Color3.new(1, 1, 1)
clearButton.TextSize = 18
clearButton.Font = Enum.Font.SourceSans
clearButton.Parent = additionalGUI
local optionalSettingToggle = Instance.new("TextButton")
optionalSettingToggle.Size = UDim2.new(0.95, 0, 0, 30)
optionalSettingToggle.Position = UDim2.new(0.023, 0, 0, 80)
optionalSettingToggle.BackgroundColor3 = Color3.new(0.2, 0.2, 0.2)
optionalSettingToggle.Text = "Copy as link"
optionalSettingToggle.TextColor3 = Color3.new(1, 1, 1)
optionalSettingToggle.TextSize = 18
optionalSettingToggle.Font = Enum.Font.SourceSans
optionalSettingToggle.Parent = additionalGUI
local toggleButton = Instance.new("ImageButton")
toggleButton.Size = UDim2.new(0, 30, 0, 30)
toggleButton.Position = UDim2.new(0.002, 0, 0, 0)
toggleButton.BackgroundTransparency = 1
toggleButton.Image = "rbxassetid://11932591062"
toggleButton.Parent = topBar
toggleButton.MouseButton1Click:Connect(function()
additionalGUI.Visible = not additionalGUI.Visible
end)
local isMinimized = false
local originalSize = frame.Size
local originalTitlePosition = titleLabel.Position
minimizeButton.MouseButton1Click:Connect(function()
isMinimized = not isMinimized
if isMinimized then
minimizeButton.Text = "+"
frame.Size = UDim2.new(originalSize.X.Scale, originalSize.X.Offset, 0, 30)
scrollFrame.Visible = false
additionalGUI.Visible = false
toggleButton.Visible = false
titleLabel.Position = UDim2.new(originalTitlePosition.X.Scale, originalTitlePosition.X.Offset - 20, originalTitlePosition.Y.Scale, originalTitlePosition.Y.Offset)
else
minimizeButton.Text = "-"
frame.Size = originalSize
scrollFrame.Visible = true
toggleButton.Visible = true
titleLabel.Position = originalTitlePosition
end
end)
clearButton.MouseButton1Click:Connect(function()
for _, child in ipairs(scrollFrame:GetChildren()) do
if child:IsA("TextButton") then
child:Destroy()
end
end
loggedAnimations = {}
scrollFrame.CanvasSize = UDim2.new(0, 0, 0, 0)
end)
local function toggleOptionalSetting()
isCopyingAsLinkEnabled = not isCopyingAsLinkEnabled
optionalSettingToggle.BackgroundColor3 = isCopyingAsLinkEnabled and toggleColor or originalColor
print("Copying as link " .. (isCopyingAsLinkEnabled and "enabled" or "disabled"))
end
optionalSettingToggle.MouseButton1Click:Connect(toggleOptionalSetting)
local function onAnimationPlayed(animationTrack)
local animation = animationTrack.Animation
if animation then
local animationId = animation.AnimationId
local animationName = animation.Name or "Unknown Animation"
logAnimation(animationName, animationId)
end
end
local function trackPlayerAnimations()
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
humanoid.AnimationPlayed:Connect(onAnimationPlayed)
end
trackPlayerAnimations()