local Players = game:GetService("Players") local RunService = game:GetService("RunService") local TweenService = game:GetService("TweenService") local UserInputService = game:GetService("UserInputService") local LocalPlayer = Players.LocalPlayer local PlayerGui = LocalPlayer:WaitForChild("PlayerGui") local CONFIG = { BRAND_NAME = "HilosHAX", SAMPLE_RATE_HZ = 30, MAX_DURATION_SEC = 20, DEFAULT_DURATION_SEC = 10, DEFAULT_PLAYBACK_SPEED = 1.0, GHOST_COLOR = Color3.fromRGB(168, 85, 247), GHOST_ACCENT = Color3.fromRGB(203, 213, 225), GHOST_TRANSPARENCY = 0.52, PATH_NODE_INTERVAL = 3, UI_ACCENT = Color3.fromRGB(147, 51, 234), UI_ACCENT_LIGHT = Color3.fromRGB(168, 85, 247), UI_BG_DARK = Color3.fromRGB(14, 18, 34), UI_SURFACE = Color3.fromRGB(22, 27, 48), UI_TEXT = Color3.fromRGB(241, 245, 249), UI_MUTED = Color3.fromRGB(148, 163, 184), UI_ONLINE = Color3.fromRGB(34, 197, 94), } local MAX_FRAMES = CONFIG.SAMPLE_RATE_HZ * CONFIG.MAX_DURATION_SEC local SAMPLE_INTERVAL = 1 / CONFIG.SAMPLE_RATE_HZ local Janitor = {} Janitor.__index = Janitor function Janitor.new() return setmetatable({ _tasks = {} :: { any } }, Janitor) end function Janitor:Add(taskObj: T): T table.insert(self._tasks, taskObj) return taskObj end function Janitor:Cleanup() for i = #self._tasks, 1, -1 do local taskObj = self._tasks[i] self._tasks[i] = nil if typeof(taskObj) == "RBXScriptConnection" then taskObj:Disconnect() elseif typeof(taskObj) == "Instance" then taskObj:Destroy() elseif type(taskObj) == "function" then taskObj() elseif type(taskObj) == "table" and type(taskObj.Destroy) == "function" then taskObj:Destroy() end end end type FrameSlot = { timestamp: number, cframes: { [number]: CFrame }, } local ReplayBuffer = {} ReplayBuffer.__index = ReplayBuffer function ReplayBuffer.new(capacity: number) local slots = table.create(capacity) :: { FrameSlot } for i = 1, capacity do slots[i] = { timestamp = 0, cframes = {}, } end return setmetatable({ _capacity = capacity, _slots = slots, _head = 0, _count = 0, }, ReplayBuffer) end function ReplayBuffer:Clear() self._head = 0 self._count = 0 for i = 1, self._capacity do self._slots[i].timestamp = 0 table.clear(self._slots[i].cframes) end end function ReplayBuffer:Push(timestamp: number, trackedParts: { BasePart }) self._head = (self._head % self._capacity) + 1 if self._count < self._capacity then self._count += 1 end local slot = self._slots[self._head] slot.timestamp = timestamp local cfMap = slot.cframes table.clear(cfMap) for partId, part in ipairs(trackedParts) do if part.Parent ~= nil then cfMap[partId] = part.CFrame end end end function ReplayBuffer:GetWindowFrames(windowSec: number): { FrameSlot } if self._count == 0 then return {} end local newestSlot = self._slots[self._head] local cutoffTime = newestSlot.timestamp - windowSec local result = {} local startOffset = self._count - 1 for offset = startOffset, 0, -1 do local idx = ((self._head - 1 - offset) % self._capacity) + 1 local slot = self._slots[idx] if slot.timestamp >= cutoffTime then table.insert(result, slot) end end return result end function ReplayBuffer:GetCount(): number return self._count end local GhostVisualizer = {} GhostVisualizer.__index = GhostVisualizer function GhostVisualizer.new() return setmetatable({ _rootFolder = nil :: Folder?, _ghostModel = nil :: Model?, _pathFolder = nil :: Folder?, _ghostParts = {} :: { [number]: BasePart }, _rootPartId = 1, _isPlaying = false, _isLooping = true, _showPath = true, _playbackSpeed = CONFIG.DEFAULT_PLAYBACK_SPEED, _frames = {} :: { FrameSlot }, _elapsed = 0, _duration = 0, _onProgress = nil :: ((number) -> ())?, _onFinished = nil :: (() -> ())?, }, GhostVisualizer) end function GhostVisualizer:_EnsureFolders() if not self._rootFolder or not self._rootFolder.Parent then local folder = Instance.new("Folder") folder.Name = "_HilosHAX_GhostVisuals" folder.Parent = workspace self._rootFolder = folder end if not self._pathFolder or not self._pathFolder.Parent then local pFolder = Instance.new("Folder") pFolder.Name = "PathTrail" pFolder.Parent = self._rootFolder self._pathFolder = pFolder end end function GhostVisualizer:BuildGhostFromParts(trackedParts: { BasePart }, rootPartId: number) self:ClearGhost() self:_EnsureFolders() self._rootPartId = rootPartId local model = Instance.new("Model") model.Name = "HilosHAX_GhostRig" for partId, srcPart in ipairs(trackedParts) do local ghostPart: BasePart? = nil local ok, cloned = pcall(function() local prevArchivable = srcPart.Archivable srcPart.Archivable = true local c = srcPart:Clone() srcPart.Archivable = prevArchivable return c end) if ok and cloned and cloned:IsA("BasePart") then for _, child in ipairs(cloned:GetChildren()) do if not (child:IsA("SpecialMesh") or child:IsA("DataModelMesh")) then child:Destroy() end end ghostPart = cloned else local fallback = Instance.new("Part") fallback.Size = srcPart.Size fallback.Shape = Enum.PartType.Block ghostPart = fallback end if ghostPart then local isInvisibleRoot = (srcPart.Name == "HumanoidRootPart" and srcPart.Transparency >= 0.99) ghostPart.Name = "Ghost_" .. tostring(partId) ghostPart.Anchored = true ghostPart.CanCollide = false ghostPart.CanTouch = false ghostPart.CanQuery = false ghostPart.CastShadow = false ghostPart.Material = Enum.Material.Neon ghostPart.Color = CONFIG.GHOST_COLOR ghostPart.Transparency = if isInvisibleRoot then 1 else CONFIG.GHOST_TRANSPARENCY ghostPart.CFrame = srcPart.CFrame ghostPart.Parent = model self._ghostParts[partId] = ghostPart end end model.Parent = self._rootFolder self._ghostModel = model end function GhostVisualizer:RenderPathTrail(frames: { FrameSlot }, rootPartId: number) self:ClearPath() if not self._showPath or #frames < 2 then return end self:_EnsureFolders() local prevPos: Vector3? = nil local step = math.max(1, CONFIG.PATH_NODE_INTERVAL) for i = 1, #frames, step do local cf = frames[i].cframes[rootPartId] if cf then local pos = cf.Position if prevPos then local dist = (pos - prevPos).Magnitude if dist > 0.05 then local seg = Instance.new("Part") seg.Name = "PathSeg" seg.Anchored = true seg.CanCollide = false seg.CanTouch = false seg.CanQuery = false seg.CastShadow = false seg.Material = Enum.Material.Neon seg.Color = CONFIG.GHOST_ACCENT seg.Transparency = 0.45 seg.Size = Vector3.new(0.14, 0.14, dist) seg.CFrame = CFrame.lookAt(prevPos:Lerp(pos, 0.5), pos) seg.Parent = self._pathFolder end end prevPos = pos end end end function GhostVisualizer:StartPlayback(frames: { FrameSlot }, trackedParts: { BasePart }, rootPartId: number) if #frames < 2 then return false end self:BuildGhostFromParts(trackedParts, rootPartId) self._frames = frames self._elapsed = 0 self._duration = math.max(0.001, frames[#frames].timestamp - frames[1].timestamp) self._isPlaying = true self:RenderPathTrail(frames, rootPartId) self:ApplyFrameAtProgress(0) return true end function GhostVisualizer:ApplyFrameAtProgress(alpha: number) local frames = self._frames local count = #frames if count < 2 then return end alpha = math.clamp(alpha, 0, 1) local startTime = frames[1].timestamp local targetTime = startTime + (self._duration * alpha) local lo = 1 local hi = count while hi - lo > 1 do local mid = math.floor((lo + hi) / 2) if frames[mid].timestamp <= targetTime then lo = mid else hi = mid end end local frameA = frames[lo] local frameB = frames[hi] local span = frameB.timestamp - frameA.timestamp local t = if span > 0.0001 then math.clamp((targetTime - frameA.timestamp) / span, 0, 1) else 0 for partId, ghostPart in pairs(self._ghostParts) do local cfA = frameA.cframes[partId] local cfB = frameB.cframes[partId] if cfA and cfB then ghostPart.CFrame = cfA:Lerp(cfB, t) elseif cfA then ghostPart.CFrame = cfA elseif cfB then ghostPart.CFrame = cfB end end end function GhostVisualizer:Step(dt: number) if not self._isPlaying or #self._frames < 2 then return end self._elapsed += dt * self._playbackSpeed local alpha = self._elapsed / self._duration if alpha >= 1 then if self._isLooping then self._elapsed = self._elapsed % self._duration alpha = self._elapsed / self._duration else alpha = 1 self._isPlaying = false self:ApplyFrameAtProgress(alpha) if self._onProgress then self._onProgress(1) end if self._onFinished then self._onFinished() end return end end self:ApplyFrameAtProgress(alpha) if self._onProgress then self._onProgress(alpha) end end function GhostVisualizer:Scrub(alpha: number) if #self._frames < 2 then return end self._elapsed = math.clamp(alpha, 0, 1) * self._duration self:ApplyFrameAtProgress(alpha) end function GhostVisualizer:SetPlaying(playing: boolean) self._isPlaying = playing end function GhostVisualizer:SetLooping(looping: boolean) self._isLooping = looping end function GhostVisualizer:SetShowPath(show: boolean) self._showPath = show if not show then self:ClearPath() elseif #self._frames >= 2 then self:RenderPathTrail(self._frames, self._rootPartId) end end function GhostVisualizer:SetSpeed(speed: number) self._playbackSpeed = math.clamp(speed, 0.1, 4.0) end function GhostVisualizer:ClearGhost() self._isPlaying = false table.clear(self._ghostParts) if self._ghostModel then self._ghostModel:Destroy() self._ghostModel = nil end end function GhostVisualizer:ClearPath() if self._pathFolder then self._pathFolder:ClearAllChildren() end end function GhostVisualizer:Destroy() self:ClearGhost() self:ClearPath() if self._rootFolder then self._rootFolder:Destroy() self._rootFolder = nil end end local function tween(obj: Instance, props: { [string]: any }, duration: number?) local info = TweenInfo.new(duration or 0.18, Enum.EasingStyle.Quad, Enum.EasingDirection.Out) local tw = TweenService:Create(obj, info, props) tw:Play() return tw end local function addCorner(parent: Instance, radius: number) local corner = Instance.new("UICorner") corner.CornerRadius = UDim.new(0, radius) corner.Parent = parent return corner end local function addStroke(parent: Instance, color: Color3, transparency: number, thickness: number?) local stroke = Instance.new("UIStroke") stroke.Color = color stroke.Transparency = transparency stroke.Thickness = thickness or 1 stroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border stroke.Parent = parent return stroke end local AppJanitor = Janitor.new() local CharJanitor = Janitor.new() AppJanitor:Add(CharJanitor) local buffer = ReplayBuffer.new(MAX_FRAMES) local visualizer = GhostVisualizer.new() AppJanitor:Add(visualizer) local state = { isRecording = true, windowDuration = CONFIG.DEFAULT_DURATION_SEC, trackedParts = {} :: { BasePart }, rootPartId = 1, sampleAccumulator = 0, } local function bindCharacter(character: Model) CharJanitor:Cleanup() table.clear(state.trackedParts) buffer:Clear() local hrp = character:WaitForChild("HumanoidRootPart", 5) if not character.Parent then return end table.clear(state.trackedParts) state.rootPartId = 1 for _, desc in ipairs(character:GetDescendants()) do if desc:IsA("BasePart") then table.insert(state.trackedParts, desc) if desc == hrp or desc.Name == "HumanoidRootPart" then state.rootPartId = #state.trackedParts end end end CharJanitor:Add(character.DescendantAdded:Connect(function(desc) if desc:IsA("BasePart") then table.insert(state.trackedParts, desc) end end)) CharJanitor:Add(character.DescendantRemoving:Connect(function(desc) if desc:IsA("BasePart") then local idx = table.find(state.trackedParts, desc) if idx then table.remove(state.trackedParts, idx) end end end)) end if LocalPlayer.Character then task.spawn(bindCharacter, LocalPlayer.Character) end AppJanitor:Add(LocalPlayer.CharacterAdded:Connect(bindCharacter)) local existingGui = PlayerGui:FindFirstChild("HilosHAX_GhostUI") if existingGui then existingGui:Destroy() end local screenGui = Instance.new("ScreenGui") screenGui.Name = "HilosHAX_GhostUI" screenGui.ResetOnSpawn = false screenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling screenGui.Parent = PlayerGui AppJanitor:Add(screenGui) local WINDOW_WIDTH = 340 local WINDOW_HEIGHT = 448 local mainFrame = Instance.new("Frame") mainFrame.Name = "MainWindow" mainFrame.Size = UDim2.fromOffset(WINDOW_WIDTH, WINDOW_HEIGHT) mainFrame.Position = UDim2.new(1, -(WINDOW_WIDTH + 20), 0.5, -(WINDOW_HEIGHT / 2)) mainFrame.BackgroundColor3 = CONFIG.UI_BG_DARK mainFrame.BackgroundTransparency = 0.05 mainFrame.ClipsDescendants = true mainFrame.Parent = screenGui addCorner(mainFrame, 14) addStroke(mainFrame, CONFIG.UI_ACCENT_LIGHT, 0.72, 1.2) local bgGradient = Instance.new("UIGradient") bgGradient.Color = ColorSequence.new({ ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 255, 255)), ColorSequenceKeypoint.new(1, Color3.fromRGB(190, 185, 230)), }) bgGradient.Rotation = 135 bgGradient.Parent = mainFrame local header = Instance.new("Frame") header.Name = "Header" header.Size = UDim2.new(1, 0, 0, 48) header.BackgroundColor3 = CONFIG.UI_SURFACE header.BackgroundTransparency = 0.2 header.BorderSizePixel = 0 header.Parent = mainFrame local headerLine = Instance.new("Frame") headerLine.Size = UDim2.new(1, 0, 0, 1) headerLine.Position = UDim2.new(0, 0, 1, -1) headerLine.BackgroundColor3 = CONFIG.UI_ACCENT_LIGHT headerLine.BackgroundTransparency = 0.65 headerLine.BorderSizePixel = 0 headerLine.Parent = header local brandBadge = Instance.new("Frame") brandBadge.Size = UDim2.fromOffset(26, 26) brandBadge.Position = UDim2.new(0, 12, 0.5, -13) brandBadge.BackgroundColor3 = Color3.fromRGB(10, 12, 22) brandBadge.Parent = header addCorner(brandBadge, 13) addStroke(brandBadge, CONFIG.UI_MUTED, 0.4, 1.2) local crownLabel = Instance.new("TextLabel") crownLabel.Size = UDim2.fromScale(1, 1) crownLabel.BackgroundTransparency = 1 crownLabel.Font = Enum.Font.GothamBold crownLabel.TextSize = 14 crownLabel.TextColor3 = CONFIG.UI_ACCENT_LIGHT crownLabel.Text = "♛" crownLabel.Parent = brandBadge local titleLabel = Instance.new("TextLabel") titleLabel.Size = UDim2.new(1, -125, 0, 20) titleLabel.Position = UDim2.fromOffset(46, 6) titleLabel.BackgroundTransparency = 1 titleLabel.RichText = true titleLabel.Font = Enum.Font.GothamBold titleLabel.TextSize = 14 titleLabel.TextColor3 = CONFIG.UI_TEXT titleLabel.TextXAlignment = Enum.TextXAlignment.Left titleLabel.Text = 'hilos HAX // REPLAY' titleLabel.Parent = header local subLabel = Instance.new("TextLabel") subLabel.Size = UDim2.new(1, -125, 0, 14) subLabel.Position = UDim2.fromOffset(46, 26) subLabel.BackgroundTransparency = 1 subLabel.Font = Enum.Font.GothamMedium subLabel.TextSize = 10 subLabel.TextColor3 = CONFIG.UI_MUTED subLabel.TextXAlignment = Enum.TextXAlignment.Left subLabel.Text = "3D Ghost & Path Visualizer" subLabel.Parent = header local statusDot = Instance.new("Frame") statusDot.Size = UDim2.fromOffset(8, 8) statusDot.Position = UDim2.new(1, -70, 0.5, -4) statusDot.BackgroundColor3 = CONFIG.UI_ONLINE statusDot.Parent = header addCorner(statusDot, 4) local minBtn = Instance.new("TextButton") minBtn.Size = UDim2.fromOffset(24, 24) minBtn.Position = UDim2.new(1, -54, 0.5, -12) minBtn.BackgroundColor3 = Color3.fromRGB(255, 255, 255) minBtn.BackgroundTransparency = 0.92 minBtn.Font = Enum.Font.GothamBold minBtn.TextSize = 14 minBtn.TextColor3 = CONFIG.UI_MUTED minBtn.Text = "–" minBtn.Parent = header addCorner(minBtn, 6) local closeBtn = Instance.new("TextButton") closeBtn.Size = UDim2.fromOffset(24, 24) closeBtn.Position = UDim2.new(1, -26, 0.5, -12) closeBtn.BackgroundColor3 = Color3.fromRGB(239, 68, 68) closeBtn.BackgroundTransparency = 0.85 closeBtn.Font = Enum.Font.GothamBold closeBtn.TextSize = 12 closeBtn.TextColor3 = Color3.fromRGB(252, 165, 165) closeBtn.Text = "✕" closeBtn.Parent = header addCorner(closeBtn, 6) local content = Instance.new("Frame") content.Size = UDim2.new(1, 0, 1, -70) content.Position = UDim2.fromOffset(0, 48) content.BackgroundTransparency = 1 content.Parent = mainFrame local padding = Instance.new("UIPadding") padding.PaddingTop = UDim.new(0, 12) padding.PaddingBottom = UDim.new(0, 8) padding.PaddingLeft = UDim.new(0, 14) padding.PaddingRight = UDim.new(0, 14) padding.Parent = content local layout = Instance.new("UIListLayout") layout.Padding = UDim.new(0, 10) layout.SortOrder = Enum.SortOrder.LayoutOrder layout.Parent = content local telemetryLabel = Instance.new("TextLabel") telemetryLabel.LayoutOrder = 1 telemetryLabel.Size = UDim2.new(1, 0, 0, 18) telemetryLabel.BackgroundTransparency = 1 telemetryLabel.Font = Enum.Font.Code telemetryLabel.TextSize = 11 telemetryLabel.TextColor3 = CONFIG.UI_MUTED telemetryLabel.TextXAlignment = Enum.TextXAlignment.Left telemetryLabel.Text = "REC: ACTIVE | FRAMES: 0 / 600 | PARTS: 0" telemetryLabel.Parent = content local btnRow = Instance.new("Frame") btnRow.LayoutOrder = 2 btnRow.Size = UDim2.new(1, 0, 0, 34) btnRow.BackgroundTransparency = 1 btnRow.Parent = content local function createButton(text: string, size: UDim2, pos: UDim2, bgColor: Color3, parent: Instance): TextButton local btn = Instance.new("TextButton") btn.Size = size btn.Position = pos btn.BackgroundColor3 = bgColor btn.BackgroundTransparency = 0.12 btn.Font = Enum.Font.GothamSemiBold btn.TextSize = 12 btn.TextColor3 = CONFIG.UI_TEXT btn.Text = text btn.AutoButtonColor = false btn.Parent = parent addCorner(btn, 8) addStroke(btn, Color3.fromRGB(255, 255, 255), 0.86, 1) btn.MouseEnter:Connect(function() tween(btn, { BackgroundTransparency = 0 }, 0.12) end) btn.MouseLeave:Connect(function() tween(btn, { BackgroundTransparency = 0.12 }, 0.12) end) return btn end local spawnBtn = createButton("▶ Spawn & Play Ghost", UDim2.new(0.64, -4, 1, 0), UDim2.new(0, 0, 0, 0), CONFIG.UI_ACCENT, btnRow) local clearBtn = createButton("Clear", UDim2.new(0.36, -4, 1, 0), UDim2.new(0.64, 4, 0, 0), CONFIG.UI_SURFACE, btnRow) local function createToggle(labelText: string, defaultState: boolean, order: number, onChanged: (boolean) -> ()) local row = Instance.new("Frame") row.LayoutOrder = order row.Size = UDim2.new(1, 0, 0, 30) row.BackgroundColor3 = CONFIG.UI_SURFACE row.BackgroundTransparency = 0.4 row.Parent = content addCorner(row, 8) local lbl = Instance.new("TextLabel") lbl.Size = UDim2.new(1, -60, 1, 0) lbl.Position = UDim2.fromOffset(10, 0) lbl.BackgroundTransparency = 1 lbl.Font = Enum.Font.GothamMedium lbl.TextSize = 12 lbl.TextColor3 = CONFIG.UI_TEXT lbl.TextXAlignment = Enum.TextXAlignment.Left lbl.Text = labelText lbl.Parent = row local pill = Instance.new("TextButton") pill.Size = UDim2.fromOffset(40, 20) pill.Position = UDim2.new(1, -48, 0.5, -10) pill.BackgroundColor3 = if defaultState then CONFIG.UI_ACCENT else Color3.fromRGB(51, 65, 85) pill.Text = "" pill.AutoButtonColor = false pill.Parent = row addCorner(pill, 10) local knob = Instance.new("Frame") knob.Size = UDim2.fromOffset(14, 14) knob.Position = if defaultState then UDim2.fromOffset(23, 3) else UDim2.fromOffset(3, 3) knob.BackgroundColor3 = CONFIG.UI_TEXT knob.Parent = pill addCorner(knob, 7) local isOn = defaultState pill.MouseButton1Click:Connect(function() isOn = not isOn tween(pill, { BackgroundColor3 = if isOn then CONFIG.UI_ACCENT else Color3.fromRGB(51, 65, 85) }, 0.15) tween(knob, { Position = if isOn then UDim2.fromOffset(23, 3) else UDim2.fromOffset(3, 3) }, 0.15) onChanged(isOn) end) end local function createSlider(labelText: string, minVal: number, maxVal: number, defaultVal: number, suffix: string, order: number, onChanged: (number) -> ()) local container = Instance.new("Frame") container.LayoutOrder = order container.Size = UDim2.new(1, 0, 0, 44) container.BackgroundColor3 = CONFIG.UI_SURFACE container.BackgroundTransparency = 0.4 container.Parent = content addCorner(container, 8) local lbl = Instance.new("TextLabel") lbl.Size = UDim2.new(0.65, 0, 0, 20) lbl.Position = UDim2.fromOffset(10, 4) lbl.BackgroundTransparency = 1 lbl.Font = Enum.Font.GothamMedium lbl.TextSize = 11 lbl.TextColor3 = CONFIG.UI_TEXT lbl.TextXAlignment = Enum.TextXAlignment.Left lbl.Text = labelText lbl.Parent = container local valLbl = Instance.new("TextLabel") valLbl.Size = UDim2.new(0.35, -10, 0, 20) valLbl.Position = UDim2.new(0.65, 0, 0, 4) valLbl.BackgroundTransparency = 1 valLbl.Font = Enum.Font.Code valLbl.TextSize = 11 valLbl.TextColor3 = CONFIG.UI_ACCENT_LIGHT valLbl.TextXAlignment = Enum.TextXAlignment.Right valLbl.Text = string.format("%.2f%s", defaultVal, suffix) valLbl.Parent = container local track = Instance.new("TextButton") track.Size = UDim2.new(1, -20, 0, 6) track.Position = UDim2.fromOffset(10, 29) track.BackgroundColor3 = Color3.fromRGB(42, 48, 72) track.Text = "" track.AutoButtonColor = false track.Parent = container addCorner(track, 3) local initAlpha = math.clamp((defaultVal - minVal) / (maxVal - minVal), 0, 1) local fill = Instance.new("Frame") fill.Size = UDim2.new(initAlpha, 0, 1, 0) fill.BackgroundColor3 = CONFIG.UI_ACCENT_LIGHT fill.BorderSizePixel = 0 fill.Parent = track addCorner(fill, 3) local dragging = false local function updateFromInput(inputPos: Vector3) local relX = math.clamp((inputPos.X - track.AbsolutePosition.X) / math.max(1, track.AbsoluteSize.X), 0, 1) local val = minVal + (maxVal - minVal) * relX fill.Size = UDim2.new(relX, 0, 1, 0) valLbl.Text = string.format("%.2f%s", val, suffix) onChanged(val) end track.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = true updateFromInput(input.Position) end end) AppJanitor:Add(UserInputService.InputChanged:Connect(function(input) if dragging and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then updateFromInput(input.Position) end end)) AppJanitor:Add(UserInputService.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = false end end)) return { SetVisual = function(alpha: number) if not dragging then alpha = math.clamp(alpha, 0, 1) fill.Size = UDim2.new(alpha, 0, 1, 0) local val = minVal + (maxVal - minVal) * alpha valLbl.Text = string.format("%.2f%s", val, suffix) end end, } end createToggle("Record Character Buffer", true, 3, function(enabled) state.isRecording = enabled tween(statusDot, { BackgroundColor3 = if enabled then CONFIG.UI_ONLINE else Color3.fromRGB(234, 179, 8) }, 0.15) end) createToggle("Loop Ghost Playback", true, 4, function(enabled) visualizer:SetLooping(enabled) end) createToggle("3D Trajectory Path Trail", true, 5, function(enabled) visualizer:SetShowPath(enabled) end) createSlider("Replay Window", 2, CONFIG.MAX_DURATION_SEC, CONFIG.DEFAULT_DURATION_SEC, "s", 6, function(val) state.windowDuration = val end) createSlider("Playback Speed", 0.25, 2.5, CONFIG.DEFAULT_PLAYBACK_SPEED, "x", 7, function(val) visualizer:SetSpeed(val) end) local scrubSlider = createSlider("Timeline Scrub", 0, 100, 0, "%", 8, function(val) visualizer:SetPlaying(false) visualizer:Scrub(val / 100) end) visualizer._onProgress = function(alpha: number) scrubSlider.SetVisual(alpha) end local footer = Instance.new("TextLabel") footer.Size = UDim2.new(1, -28, 0, 18) footer.Position = UDim2.new(0, 14, 1, -22) footer.BackgroundTransparency = 1 footer.RichText = true footer.Font = Enum.Font.GothamMedium footer.TextSize = 10 footer.TextColor3 = CONFIG.UI_MUTED footer.TextXAlignment = Enum.TextXAlignment.Center footer.Text = 'branded by ♛ HilosHAX • Silver 10' footer.Parent = mainFrame spawnBtn.MouseButton1Click:Connect(function() local frames = buffer:GetWindowFrames(state.windowDuration) if #frames >= 2 then visualizer:StartPlayback(frames, state.trackedParts, state.rootPartId) end end) clearBtn.MouseButton1Click:Connect(function() visualizer:ClearGhost() visualizer:ClearPath() scrubSlider.SetVisual(0) end) local isMinimized = false minBtn.MouseButton1Click:Connect(function() isMinimized = not isMinimized minBtn.Text = if isMinimized then "+" else "–" tween(mainFrame, { Size = if isMinimized then UDim2.fromOffset(WINDOW_WIDTH, 48) else UDim2.fromOffset(WINDOW_WIDTH, WINDOW_HEIGHT) }, 0.2) end) closeBtn.MouseButton1Click:Connect(function() AppJanitor:Cleanup() end) do local dragging = false local dragStart: Vector3 local startPos: UDim2 header.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = true dragStart = input.Position startPos = mainFrame.Position end end) AppJanitor:Add(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 mainFrame.Position = UDim2.new( startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y ) end end)) AppJanitor:Add(UserInputService.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = false end end)) end AppJanitor:Add(RunService.Heartbeat:Connect(function(dt: number) if state.isRecording and #state.trackedParts > 0 then state.sampleAccumulator += dt if state.sampleAccumulator >= SAMPLE_INTERVAL then state.sampleAccumulator %= SAMPLE_INTERVAL buffer:Push(os.clock(), state.trackedParts) end end telemetryLabel.Text = string.format( "REC: %s | FRAMES: %d/%d | PARTS: %d", if state.isRecording then "ACTIVE" else "PAUSED", buffer:GetCount(), MAX_FRAMES, #state.trackedParts ) end)) AppJanitor:Add(RunService.RenderStepped:Connect(function(dt: number) visualizer:Step(dt) end))