Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Services
- local Players = game:GetService("Players")
- local RunService = game:GetService("RunService")
- local Workspace = game:GetService("Workspace")
- local UserInputService = game:GetService("UserInputService")
- local player = Players.LocalPlayer
- -- Create a visual indicator UI on screen so you know when the keybind is active
- local screenGui = Instance.new("ScreenGui")
- screenGui.Name = "DesyncTestGui"
- screenGui.ResetOnSpawn = false
- screenGui.Parent = player:WaitForChild("PlayerGui")
- local label = Instance.new("TextLabel")
- label.Name = "StatusLabel"
- label.Size = UDim2.new(0, 250, 0, 40)
- label.Position = UDim2.new(0.5, -125, 0.1, 0)
- label.AnchorPoint = Vector2.new(0.5, 0.5)
- label.Text = "Press [E] to test Desync-Snap"
- label.TextSize = 16
- label.TextColor3 = Color3.new(1, 1, 1)
- label.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
- label.BorderSizePixel = 0
- label.Parent = screenGui
- local uiCorner = Instance.new("UICorner")
- uiCorner.CornerRadius = UDim.new(0, 6)
- uiCorner.Parent = label
- local function getNearestHumanoid()
- local character = player.Character
- if not character or not character:FindFirstChild("HumanoidRootPart") then return nil end
- local myRoot = character.HumanoidRootPart
- local nearestHumanoid = nil
- local shortestDistance = math.huge
- for _, descendant in ipairs(Workspace:GetDescendants()) do
- if descendant:IsA("Humanoid") then
- local enemyChar = descendant.Parent
- if enemyChar and enemyChar ~= character and enemyChar:FindFirstChild("HumanoidRootPart") then
- local enemyRoot = enemyChar.HumanoidRootPart
- local distance = (myRoot.Position - enemyRoot.Position).Magnitude
- if distance < shortestDistance then
- shortestDistance = distance
- nearestHumanoid = descendant
- end
- end
- end
- end
- return nearestHumanoid
- end
- local isDesyncing = false
- local function triggerDesyncTeleport()
- if isDesyncing then return end
- local character = player.Character
- if not character or not character:FindFirstChild("HumanoidRootPart") then return end
- local rootPart = character.HumanoidRootPart
- local targetHumanoid = getNearestHumanoid()
- if not targetHumanoid then
- label.Text = "No targets found!"
- task.wait(1)
- label.Text = "Press [E] to test Desync-Snap"
- return
- end
- local targetRoot = targetHumanoid.Parent:FindFirstChild("HumanoidRootPart")
- if not targetRoot then return end
- isDesyncing = true
- label.Text = "[STATUS]: DESYNC ACTIVE"
- label.BackgroundColor3 = Color3.fromRGB(180, 40, 40)
- -- 1. Enable Noclip locally so physics parts don't catch you
- local noclipConnection
- noclipConnection = RunService.Stepped:Connect(function()
- if character then
- for _, part in ipairs(character:GetDescendants()) do
- if part:IsA("BasePart") then
- part.CanCollide = false
- end
- end
- end
- end)
- -- 2. Zero out physics velocities to prevent weird throws
- rootPart.AssemblyLinearVelocity = Vector3.zero
- rootPart.AssemblyAngularVelocity = Vector3.zero
- -- 3. Push client into a heavy position-drop state (Void/Deep underground drop)
- -- This causes other clients' interpolation buffers to stall out, freezing your avatar model where it was.
- local voidPosition = Vector3.new(rootPart.Position.X, -600, rootPart.Position.Z)
- rootPart.CFrame = CFrame.new(voidPosition)
- -- 4. Hold the desync state for ~300ms to mimic the engine lag-compensation window
- task.wait(0.3)
- -- 5. Snap instantly to the target's position (giving you full local aiming control while your ghost model lingers behind)
- rootPart.CFrame = targetRoot.CFrame + Vector3.new(0, 3, 0)
- -- Clear momentum again at the target site
- rootPart.AssemblyLinearVelocity = Vector3.zero
- rootPart.AssemblyAngularVelocity = Vector3.zero
- -- 6. Clean up Noclip after the pop completes
- if noclipConnection then
- noclipConnection:Disconnect()
- end
- task.wait(0.5)
- isDesyncing = false
- label.Text = "Press [E] to test Desync-Snap"
- label.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
- end
- -- Bind to 'E' Key
- UserInputService.InputBegan:Connect(function(input, gameProcessed)
- if gameProcessed then return end
- if input.KeyCode == Enum.KeyCode.E then
- triggerDesyncTeleport()
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment