
Key RequiredUniversal

-- =============================================
-- CLEAN TARGET STRAFE CODE ONLY (DH121 Style + Fixed Y-Axis)
-- Copy and paste this into your script
-- =============================================
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local LocalPlayer = Players.LocalPlayer
-- ==================== STRAFE SETTINGS ====================
local StrafeSettings = {
Enabled = false,
Mode = "Orbit", -- Orbit / Random / Side
StrengthX = 10, -- Speed (rotation)
StrengthY = 8, -- Vertical Bob Height (smooth & fixed)
StrengthZ = 6, -- Orbit Distance
ManualTarget = nil, -- Player you picked from dropdown
StrafeAngle = 0,
BobAngle = 0 -- Separate bob angle (this fixes the bug)
}
-- ==================== GET TARGET (Auto or Manual) ====================
local function GetStrafeTarget()
if StrafeSettings.ManualTarget and StrafeSettings.ManualTarget.Character and StrafeSettings.ManualTarget.Character:FindFirstChild("HumanoidRootPart") then
return StrafeSettings.ManualTarget
end
-- Auto closest fallback
local closest = nil
local shortest = math.huge
for _, plr in ipairs(Players:GetPlayers()) do
if plr ~= LocalPlayer and plr.Character and plr.Character:FindFirstChild("HumanoidRootPart") then
local dist = (plr.Character.HumanoidRootPart.Position - workspace.CurrentCamera.CFrame.Position).Magnitude
if dist < shortest then
closest = plr
shortest = dist
end
end
end
return closest
end
-- ==================== MAIN STRAFE LOOP ====================
RunService.Heartbeat:Connect(function()
if not StrafeSettings.Enabled then return end
local targetPlr = GetStrafeTarget()
if not targetPlr or not targetPlr.Character or not targetPlr.Character:FindFirstChild("HumanoidRootPart") then return end
local targetRoot = targetPlr.Character.HumanoidRootPart
local myRoot = LocalPlayer.Character and LocalPlayer.Character:FindFirstChild("HumanoidRootPart")
if not myRoot then return end
if StrafeSettings.Mode == "Orbit" then
-- Smooth rotation
StrafeSettings.StrafeAngle = StrafeSettings.StrafeAngle + StrafeSettings.StrengthX
if StrafeSettings.StrafeAngle > 360 then StrafeSettings.StrafeAngle = 0 end
-- FIXED smooth vertical bob (separate angle)
StrafeSettings.BobAngle = StrafeSettings.BobAngle + 4.5
local yBob = math.sin(math.rad(StrafeSettings.BobAngle)) * StrafeSettings.StrengthY
myRoot.CFrame = targetRoot.CFrame
* CFrame.Angles(0, math.rad(StrafeSettings.StrafeAngle), 0)
* CFrame.new(0, yBob, StrafeSettings.StrengthZ)
end
if StrafeSettings.Mode == "Random" then
myRoot.CFrame = targetRoot.CFrame * CFrame.new(
math.random(-StrafeSettings.StrengthZ, StrafeSettings.StrengthZ),
StrafeSettings.StrengthY / 2,
math.random(-StrafeSettings.StrengthZ, StrafeSettings.StrengthZ)
)
end
if StrafeSettings.Mode == "Side" then
StrafeSettings.StrafeAngle = StrafeSettings.StrafeAngle + (StrafeSettings.StrengthX * 0.5)
myRoot.CFrame = targetRoot.CFrame
* CFrame.Angles(0, math.rad(StrafeSettings.StrafeAngle), 0)
* CFrame.new(StrafeSettings.StrengthZ, StrafeSettings.StrengthY / 2, 0)
end
end)
print("✅ Target Strafe (DH121 + Fixed Y-Axis) loaded!")No comments yet for this script.



