
KeylessUniversal

local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local TweenService = game:GetService("TweenService")
local LP = Players.LocalPlayer
local PG = LP:WaitForChild("PlayerGui")
local following = false
local targetPlayer = nil
local selectedName = nil
local dropOpen = false
local guiOpen = false
local hue = 0
local conns = {}
local posBuf = {}
local stateBuf = {}
local toolBuf = {}
local DELAY = 1
local RECORD_INTERVAL = 1 / 30
local SG = Instance.new("ScreenGui")
SG.Name = "FollowTraceGui"
SG.ResetOnSpawn = false
SG.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
SG.DisplayOrder = 999
SG.Parent = PG
local function createCorner(parent, radius)
local c = Instance.new("UICorner")
c.CornerRadius = UDim.new(0, radius)
c.Parent = parent
return c
end
local function createStroke(parent, thickness, color, transparency)
local s = Instance.new("UIStroke")
s.Thickness = thickness
s.Color = color or Color3.new(1, 1, 1)
s.Transparency = transparency or 0
s.Parent = parent
return s
end
local ToggleBtn = Instance.new("TextButton")
ToggleBtn.Name = "RGBToggle"
ToggleBtn.Size = UDim2.new(0, 52, 0, 52)
ToggleBtn.Position = UDim2.new(0, 16, 0.5, -26)
ToggleBtn.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
ToggleBtn.Text = "F"
ToggleBtn.TextColor3 = Color3.new(1, 1, 1)
ToggleBtn.TextSize = 24
ToggleBtn.Font = Enum.Font.GothamBold
ToggleBtn.ZIndex = 100
ToggleBtn.AutoButtonColor = false
ToggleBtn.Parent = SG
createCorner(ToggleBtn, 26)
createStroke(ToggleBtn, 2.5, Color3.new(1, 1, 1), 0.2)
local ToggleShadow = Instance.new("ImageLabel")
ToggleShadow.Name = "Shadow"
ToggleShadow.BackgroundTransparency = 1
ToggleShadow.Size = UDim2.new(1, 16, 1, 16)
ToggleShadow.Position = UDim2.new(0, -8, 0, -8)
ToggleShadow.ZIndex = 99
ToggleShadow.Image = "rbxassetid://6015897843"
ToggleShadow.ImageColor3 = Color3.new(0, 0, 0)
ToggleShadow.ImageTransparency = 0.5
ToggleShadow.ScaleType = Enum.ScaleType.Slice
ToggleShadow.SliceCenter = Rect.new(49, 49, 450, 450)
ToggleShadow.Parent = ToggleBtn
local MainFrame = Instance.new("Frame")
MainFrame.Name = "MainFrame"
MainFrame.Size = UDim2.new(0, 240, 0, 350)
MainFrame.Position = UDim2.new(0.5, -120, 0.5, -175)
MainFrame.BackgroundColor3 = Color3.fromRGB(22, 22, 30)
MainFrame.BorderSizePixel = 0
MainFrame.Visible = false
MainFrame.ZIndex = 50
MainFrame.Parent = SG
createCorner(MainFrame, 12)
createStroke(MainFrame, 1.5, Color3.fromRGB(60, 60, 80), 0)
local TopBar = Instance.new("Frame")
TopBar.Name = "TopBar"
TopBar.Size = UDim2.new(1, 0, 0, 38)
TopBar.BackgroundColor3 = Color3.fromRGB(30, 30, 42)
TopBar.BorderSizePixel = 0
TopBar.ZIndex = 51
TopBar.Parent = MainFrame
createCorner(TopBar, 12)
local TopBarFill = Instance.new("Frame")
TopBarFill.Name = "Fill"
TopBarFill.Size = UDim2.new(1, 0, 0, 16)
TopBarFill.Position = UDim2.new(0, 0, 1, -16)
TopBarFill.BackgroundColor3 = Color3.fromRGB(30, 30, 42)
TopBarFill.BorderSizePixel = 0
TopBarFill.ZIndex = 51
TopBarFill.Parent = TopBar
local TitleLabel = Instance.new("TextLabel")
TitleLabel.Name = "Title"
TitleLabel.Size = UDim2.new(1, -16, 1, 0)
TitleLabel.Position = UDim2.new(0, 12, 0, 0)
TitleLabel.BackgroundTransparency = 1
TitleLabel.Text = "Follow Trace"
TitleLabel.TextColor3 = Color3.new(1, 1, 1)
TitleLabel.TextSize = 16
TitleLabel.Font = Enum.Font.GothamBold
TitleLabel.TextXAlignment = Enum.TextXAlignment.Left
TitleLabel.ZIndex = 52
TitleLabel.Parent = TopBar
local AccentBar = Instance.new("Frame")
AccentBar.Name = "Accent"
AccentBar.Size = UDim2.new(1, 0, 0, 2)
AccentBar.Position = UDim2.new(0, 0, 0, 38)
AccentBar.BorderSizePixel = 0
AccentBar.ZIndex = 52
AccentBar.Parent = MainFrame
local ContentFrame = Instance.new("Frame")
ContentFrame.Name = "Content"
ContentFrame.Size = UDim2.new(1, -24, 1, -52)
ContentFrame.Position = UDim2.new(0, 12, 0, 46)
ContentFrame.BackgroundTransparency = 1
ContentFrame.ZIndex = 51
ContentFrame.Parent = MainFrame
local StatusLabel = Instance.new("TextLabel")
StatusLabel.Name = "Status"
StatusLabel.Size = UDim2.new(1, 0, 0, 18)
StatusLabel.Position = UDim2.new(0, 0, 0, 0)
StatusLabel.BackgroundTransparency = 1
StatusLabel.Text = "Status: Idle"
StatusLabel.TextColor3 = Color3.fromRGB(160, 160, 180)
StatusLabel.TextSize = 13
StatusLabel.Font = Enum.Font.Gotham
StatusLabel.TextXAlignment = Enum.TextXAlignment.Left
StatusLabel.ZIndex = 52
StatusLabel.Parent = ContentFrame
local DropdownBtn = Instance.new("TextButton")
DropdownBtn.Name = "DropdownBtn"
DropdownBtn.Size = UDim2.new(1, 0, 0, 36)
DropdownBtn.Position = UDim2.new(0, 0, 0, 24)
DropdownBtn.BackgroundColor3 = Color3.fromRGB(35, 35, 50)
DropdownBtn.Text = " Select Player ▼"
DropdownBtn.TextColor3 = Color3.fromRGB(200, 200, 210)
DropdownBtn.TextSize = 14
DropdownBtn.Font = Enum.Font.GothamSemibold
DropdownBtn.TextXAlignment = Enum.TextXAlignment.Left
DropdownBtn.AutoButtonColor = false
DropdownBtn.ZIndex = 53
DropdownBtn.Parent = ContentFrame
createCorner(DropdownBtn, 8)
createStroke(DropdownBtn, 1, Color3.fromRGB(55, 55, 75), 0)
local DropdownList = Instance.new("ScrollingFrame")
DropdownList.Name = "DropdownList"
DropdownList.Size = UDim2.new(1, 0, 0, 0)
DropdownList.Position = UDim2.new(0, 0, 0, 62)
DropdownList.BackgroundColor3 = Color3.fromRGB(30, 30, 44)
DropdownList.BorderSizePixel = 0
DropdownList.Visible = false
DropdownList.ZIndex = 60
DropdownList.ScrollBarThickness = 4
DropdownList.ScrollBarImageColor3 = Color3.fromRGB(100, 100, 140)
DropdownList.CanvasSize = UDim2.new(0, 0, 0, 0)
DropdownList.AutomaticCanvasSize = Enum.AutomaticSize.Y
DropdownList.ClipsDescendants = true
DropdownList.Parent = ContentFrame
createCorner(DropdownList, 8)
createStroke(DropdownList, 1, Color3.fromRGB(55, 55, 75), 0)
local ListLayout = Instance.new("UIListLayout")
ListLayout.SortOrder = Enum.SortOrder.LayoutOrder
ListLayout.Padding = UDim.new(0, 2)
ListLayout.Parent = DropdownList
local ListPad = Instance.new("UIPadding")
ListPad.PaddingTop = UDim.new(0, 3)
ListPad.PaddingBottom = UDim.new(0, 3)
ListPad.PaddingLeft = UDim.new(0, 3)
ListPad.PaddingRight = UDim.new(0, 3)
ListPad.Parent = DropdownList
local ButtonHolder = Instance.new("Frame")
ButtonHolder.Name = "Buttons"
ButtonHolder.Size = UDim2.new(1, 0, 0, 90)
ButtonHolder.Position = UDim2.new(0, 0, 1, -90)
ButtonHolder.BackgroundTransparency = 1
ButtonHolder.ZIndex = 52
ButtonHolder.Parent = ContentFrame
local RandomBtn = Instance.new("TextButton")
RandomBtn.Name = "Random"
RandomBtn.Size = UDim2.new(1, 0, 0, 38)
RandomBtn.Position = UDim2.new(0, 0, 0, 0)
RandomBtn.BackgroundColor3 = Color3.fromRGB(100, 60, 180)
RandomBtn.Text = "🎲 Random Player"
RandomBtn.TextColor3 = Color3.new(1, 1, 1)
RandomBtn.TextSize = 14
RandomBtn.Font = Enum.Font.GothamBold
RandomBtn.AutoButtonColor = true
RandomBtn.ZIndex = 53
RandomBtn.Parent = ButtonHolder
createCorner(RandomBtn, 8)
local FollowBtn = Instance.new("TextButton")
FollowBtn.Name = "Follow"
FollowBtn.Size = UDim2.new(0.48, 0, 0, 42)
FollowBtn.Position = UDim2.new(0, 0, 0, 46)
FollowBtn.BackgroundColor3 = Color3.fromRGB(40, 160, 80)
FollowBtn.Text = "Follow"
FollowBtn.TextColor3 = Color3.new(1, 1, 1)
FollowBtn.TextSize = 15
FollowBtn.Font = Enum.Font.GothamBold
FollowBtn.AutoButtonColor = true
FollowBtn.ZIndex = 53
FollowBtn.Parent = ButtonHolder
createCorner(FollowBtn, 8)
local UnfollowBtn = Instance.new("TextButton")
UnfollowBtn.Name = "Unfollow"
UnfollowBtn.Size = UDim2.new(0.48, 0, 0, 42)
UnfollowBtn.Position = UDim2.new(0.52, 0, 0, 46)
UnfollowBtn.BackgroundColor3 = Color3.fromRGB(180, 45, 45)
UnfollowBtn.Text = "Unfollow"
UnfollowBtn.TextColor3 = Color3.new(1, 1, 1)
UnfollowBtn.TextSize = 15
UnfollowBtn.Font = Enum.Font.GothamBold
UnfollowBtn.AutoButtonColor = true
UnfollowBtn.ZIndex = 53
UnfollowBtn.Parent = ButtonHolder
createCorner(UnfollowBtn, 8)
local function makeDraggable(gui, handle)
local dragging = false
local dragInput = nil
local dragStart = nil
local startPos = nil
handle.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
dragging = true
dragStart = input.Position
startPos = gui.Position
input.Changed:Connect(function()
if input.UserInputState == Enum.UserInputState.End then
dragging = false
end
end)
end
end)
handle.InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
dragInput = input
end
end)
UserInputService.InputChanged:Connect(function(input)
if input == dragInput and dragging then
local delta = input.Position - dragStart
gui.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
end
end)
end
makeDraggable(MainFrame, TopBar)
local toggleDragging = false
local toggleDragStart = nil
local toggleStartPos = nil
local toggleDragInput = nil
local toggleMoved = false
ToggleBtn.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
toggleDragging = true
toggleMoved = false
toggleDragStart = input.Position
toggleStartPos = ToggleBtn.Position
input.Changed:Connect(function()
if input.UserInputState == Enum.UserInputState.End then
toggleDragging = false
if not toggleMoved then
guiOpen = not guiOpen
MainFrame.Visible = guiOpen
end
end
end)
end
end)
ToggleBtn.InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
toggleDragInput = input
end
end)
UserInputService.InputChanged:Connect(function(input)
if input == toggleDragInput and toggleDragging then
local delta = input.Position - toggleDragStart
if delta.Magnitude > 6 then
toggleMoved = true
end
if toggleMoved then
ToggleBtn.Position = UDim2.new(toggleStartPos.X.Scale, toggleStartPos.X.Offset + delta.X, toggleStartPos.Y.Scale, toggleStartPos.Y.Offset + delta.Y)
end
end
end)
local function setStatus(txt, col)
StatusLabel.Text = "Status: " .. txt
StatusLabel.TextColor3 = col or Color3.fromRGB(160, 160, 180)
end
local function clearPlayerList()
for _, child in ipairs(DropdownList:GetChildren()) do
if child:IsA("TextButton") then
child:Destroy()
end
end
end
local function selectPlayer(name)
selectedName = name
DropdownBtn.Text = " " .. name .. " ▼"
dropOpen = false
DropdownList.Visible = false
TweenService:Create(DropdownList, TweenInfo.new(0.15), {Size = UDim2.new(1, 0, 0, 0)}):Play()
end
local function getOtherPlayers()
local list = {}
for _, p in ipairs(Players:GetPlayers()) do
if p ~= LP then
table.insert(list, p)
end
end
return list
end
local function refreshPlayerList()
clearPlayerList()
local count = 0
for _, p in ipairs(Players:GetPlayers()) do
if p ~= LP then
count = count + 1
local btn = Instance.new("TextButton")
btn.Name = p.Name
btn.Size = UDim2.new(1, -6, 0, 30)
btn.BackgroundColor3 = Color3.fromRGB(42, 42, 60)
btn.Text = p.DisplayName .. " (@" .. p.Name .. ")"
btn.TextColor3 = Color3.fromRGB(210, 210, 220)
btn.TextSize = 13
btn.Font = Enum.Font.Gotham
btn.TextTruncate = Enum.TextTruncate.AtEnd
btn.AutoButtonColor = true
btn.ZIndex = 61
btn.LayoutOrder = count
btn.Parent = DropdownList
createCorner(btn, 6)
btn.MouseButton1Click:Connect(function()
selectPlayer(p.Name)
end)
end
end
local listHeight = math.min(count * 32 + 6, 130)
if dropOpen then
DropdownList.Size = UDim2.new(1, 0, 0, listHeight)
end
end
DropdownBtn.MouseButton1Click:Connect(function()
dropOpen = not dropOpen
if dropOpen then
refreshPlayerList()
DropdownList.Visible = true
local count = #getOtherPlayers()
local listHeight = math.min(count * 32 + 6, 130)
TweenService:Create(DropdownList, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {Size = UDim2.new(1, 0, 0, listHeight)}):Play()
else
TweenService:Create(DropdownList, TweenInfo.new(0.15), {Size = UDim2.new(1, 0, 0, 0)}):Play()
task.delay(0.15, function()
if not dropOpen then
DropdownList.Visible = false
end
end)
end
end)
RandomBtn.MouseButton1Click:Connect(function()
local others = getOtherPlayers()
if #others == 0 then
setStatus("No other players", Color3.fromRGB(255, 180, 60))
return
end
local pick = others[math.random(1, #others)]
selectPlayer(pick.Name)
setStatus("Picked " .. pick.DisplayName, Color3.fromRGB(180, 140, 255))
end)
RunService.RenderStepped:Connect(function(dt)
hue = (hue + dt * 0.4) % 1
local col = Color3.fromHSV(hue, 0.8, 1)
ToggleBtn.BackgroundColor3 = col
AccentBar.BackgroundColor3 = col
end)
task.spawn(function()
while true do
refreshPlayerList()
task.wait(5)
end
end)
local function cleanBuffers(currentTime)
local cutoff = currentTime - DELAY - 2
while #posBuf > 0 and posBuf[1].t < cutoff do
table.remove(posBuf, 1)
end
while #stateBuf > 0 and stateBuf[1].t < cutoff do
table.remove(stateBuf, 1)
end
while #toolBuf > 0 and toolBuf[1].t < cutoff do
table.remove(toolBuf, 1)
end
end
local function getCharacter(player)
if player and player.Character then
local hrp = player.Character:FindFirstChild("HumanoidRootPart")
local hum = player.Character:FindFirstChildOfClass("Humanoid")
if hrp and hum and hum.Health > 0 then
return player.Character, hrp, hum
end
end
return nil, nil, nil
end
local function getLerpedCFrame(targetTime)
if #posBuf == 0 then
return nil
end
if targetTime <= posBuf[1].t then
return posBuf[1].cf
end
if targetTime >= posBuf[#posBuf].t then
return posBuf[#posBuf].cf
end
for i = 1, #posBuf - 1 do
if posBuf[i].t <= targetTime and posBuf[i + 1].t >= targetTime then
local alpha = (targetTime - posBuf[i].t) / (posBuf[i + 1].t - posBuf[i].t)
return posBuf[i].cf:Lerp(posBuf[i + 1].cf, alpha)
end
end
return posBuf[#posBuf].cf
end
local function getStateAtTime(targetTime)
local result = nil
for i = #stateBuf, 1, -1 do
if stateBuf[i].t <= targetTime then
result = stateBuf[i]
break
end
end
return result
end
local lastToolIndex = 0
local function processToolBuffer(targetTime)
for i = lastToolIndex + 1, #toolBuf do
if toolBuf[i].t <= targetTime then
lastToolIndex = i
local myChar = LP.Character
if not myChar then
continue
end
local hum = myChar:FindFirstChildOfClass("Humanoid")
if not hum then
continue
end
local bp = LP:FindFirstChild("Backpack")
if toolBuf[i].action == "equip" then
local toolName = toolBuf[i].name
local tool = nil
if bp then
tool = bp:FindFirstChild(toolName)
end
if not tool then
for _, c in ipairs(myChar:GetChildren()) do
if c:IsA("Tool") and c.Name == toolName then
tool = c
break
end
end
end
if tool and tool.Parent ~= myChar then
hum:EquipTool(tool)
end
elseif toolBuf[i].action == "unequip" then
local toolName = toolBuf[i].name
for _, c in ipairs(myChar:GetChildren()) do
if c:IsA("Tool") and c.Name == toolName then
if bp then
c.Parent = bp
else
hum:UnequipTools()
end
break
end
end
end
else
break
end
end
end
local function disconnectAll()
for _, c in ipairs(conns) do
if c and c.Connected then
c:Disconnect()
end
end
conns = {}
end
local function stopFollowing()
following = false
targetPlayer = nil
disconnectAll()
posBuf = {}
stateBuf = {}
toolBuf = {}
lastToolIndex = 0
setStatus("Idle", Color3.fromRGB(160, 160, 180))
end
local recordAccum = 0
local function captureInitialTools(targetChar)
for _, c in ipairs(targetChar:GetChildren()) do
if c:IsA("Tool") then
table.insert(toolBuf, {t = 0, action = "equip", name = c.Name})
end
end
end
local function startFollowing(target)
stopFollowing()
targetPlayer = target
following = true
posBuf = {}
stateBuf = {}
toolBuf = {}
lastToolIndex = 0
recordAccum = 0
setStatus("Following " .. target.DisplayName, Color3.fromRGB(80, 220, 120))
local startTime = tick()
local function onTargetCharacterAdded(char)
local hrp = char:WaitForChild("HumanoidRootPart", 10)
local hum = char:WaitForChild("Humanoid", 10)
if not hrp or not hum then
return
end
captureInitialTools(char)
table.insert(conns, hum.StateChanged:Connect(function(_, new)
if following and targetPlayer == target then
table.insert(stateBuf, {t = tick() - startTime, state = new})
end
end))
table.insert(conns, hum.Died:Connect(function()
if following and targetPlayer == target then
task.delay(DELAY, function()
if following and targetPlayer == target then
local myChar = LP.Character
if myChar then
local myHum = myChar:FindFirstChildOfClass("Humanoid")
if myHum and myHum.Health > 0 then
myHum.Health = 0
end
end
end
end)
end
end))
table.insert(conns, char.ChildAdded:Connect(function(child)
if child:IsA("Tool") and following and targetPlayer == target then
table.insert(toolBuf, {t = tick() - startTime, action = "equip", name = child.Name})
end
end))
table.insert(conns, char.ChildRemoved:Connect(function(child)
if child:IsA("Tool") and following and targetPlayer == target then
table.insert(toolBuf, {t = tick() - startTime, action = "unequip", name = child.Name})
end
end))
end
if target.Character then
onTargetCharacterAdded(target.Character)
end
table.insert(conns, target.CharacterAdded:Connect(function(char)
if following and targetPlayer == target then
onTargetCharacterAdded(char)
end
end))
local initialTeleported = false
table.insert(conns, RunService.Heartbeat:Connect(function(dt)
if not following or targetPlayer ~= target then
return
end
local now = tick() - startTime
local tChar, tHrp, tHum = getCharacter(target)
if tChar and tHrp then
recordAccum = recordAccum + dt
if recordAccum >= RECORD_INTERVAL then
recordAccum = recordAccum - RECORD_INTERVAL
table.insert(posBuf, {t = now, cf = tHrp.CFrame, mv = tHum.MoveDirection, ws = tHum.WalkSpeed})
end
end
cleanBuffers(now)
local myChar = LP.Character
if not myChar then
return
end
local myHrp = myChar:FindFirstChild("HumanoidRootPart")
local myHum = myChar:FindFirstChildOfClass("Humanoid")
if not myHrp or not myHum or myHum.Health <= 0 then
return
end
if not initialTeleported then
if tHrp then
myHrp.CFrame = tHrp.CFrame * CFrame.new(0, 0, 3)
initialTeleported = true
end
return
end
if now < DELAY then
return
end
local targetTime = now - DELAY
local cf = getLerpedCFrame(targetTime)
if cf then
myHrp.CFrame = cf
end
local stateData = getStateAtTime(targetTime)
if stateData then
if stateData.state == Enum.HumanoidStateType.Jumping then
myHum:ChangeState(Enum.HumanoidStateType.Jumping)
elseif stateData.state == Enum.HumanoidStateType.Climbing then
myHum:ChangeState(Enum.HumanoidStateType.Climbing)
elseif stateData.state == Enum.HumanoidStateType.Swimming then
myHum:ChangeState(Enum.HumanoidStateType.Swimming)
elseif stateData.state == Enum.HumanoidStateType.Seated then
myHum:ChangeState(Enum.HumanoidStateType.Seated)
elseif stateData.state == Enum.HumanoidStateType.Freefall then
myHum:ChangeState(Enum.HumanoidStateType.Freefall)
end
end
processToolBuffer(targetTime)
end))
table.insert(conns, target.AncestryChanged:Connect(function()
if not target:IsDescendantOf(Players) then
stopFollowing()
setStatus("Target left", Color3.fromRGB(255, 100, 100))
end
end))
end
FollowBtn.MouseButton1Click:Connect(function()
if not selectedName then
setStatus("No player selected", Color3.fromRGB(255, 180, 60))
return
end
local target = Players:FindFirstChild(selectedName)
if not target then
setStatus("Player not found", Color3.fromRGB(255, 100, 100))
return
end
if target == LP then
return
end
local _, tHrp, _ = getCharacter(target)
if not tHrp then
setStatus("Target has no character", Color3.fromRGB(255, 180, 60))
return
end
startFollowing(target)
end)
UnfollowBtn.MouseButton1Click:Connect(function()
stopFollowing()
end)
LP.CharacterAdded:Connect(function(char)
if following and targetPlayer then
task.wait(1)
if following and targetPlayer then
local tChar, tHrp, tHum = getCharacter(targetPlayer)
if tHrp then
local myHrp = char:WaitForChild("HumanoidRootPart", 10)
if myHrp then
myHrp.CFrame = tHrp.CFrame * CFrame.new(0, 0, 3)
end
end
local oldTarget = targetPlayer
startFollowing(oldTarget)
end
end
end)No comments yet for this script.



