Sword Fighting AI
Key RequiredUniversal

Sword Fighting AI

Universal ScriptZegHubZegHub 6.5K views 698 executesUpdated Aug 29, 2025
2.5/ 5(4 votes)
2250% Positive
Lua Script•167 lines (5402 chars)
local OrionLib = loadstring(game:HttpGet(('https://raw.githubusercontent.com/jensonhirst/Orion/main/source')))()

--[[
	WARNING: Heads up! This script has not been verified by ScriptBlox. Use at your own risk!
]]
_G.x = nil -- target, dont change e
print("loaded")
Grips = {
	Up = CFrame.new(0, 0, -1.70000005, 0, 0, 1, 1, 0, 0, 0, 1, 0),
	Out = CFrame.new(0, 0, -1.70000005, 0, 1, 0, 1, -0, 0, 0, 0, -1)
}

_G.e = nil
_G.rage = 0
local h3 = 0
local h4 = false
local h = 3
local h2 = 0
_G.g = nil
_G.pos = nil
local jo = 0
local jo2 = 1
hhh = false
local jo3 = 0
local player = game.Players.LocalPlayer

local numba = Instance.new("NumberValue",workspace)
numba.Value = -40
delay(0,function()
	while true do
		wait(0.14)
		numba.Value = math.random(-90,-35)
		game.TweenService:Create(numba, TweenInfo.new(0.07,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,1,true,0),{Value = math.random(35,90)}):Play()
	end
end)
delay(5,function()
	bg = Instance.new("BodyGyro",game.ReplicatedStorage)
	bg.D = 1
	bg.CFrame = CFrame.new(game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame.LookVector)
	bg.P = 30000
	bg.MaxTorque = Vector3.new(400000000, 400000000, 400000000)

	game:GetService("RunService").RenderStepped:Connect(function()
		if _G.x ~= nil and _G.x:FindFirstChild("HumanoidRootPart") and _G.y == 1 and player.Character and player.Character.Humanoid.Health > 0 then
			bg.Parent = game.Players.LocalPlayer.Character.HumanoidRootPart
			local torso = player.Character.HumanoidRootPart.CFrame.p+player.Character.HumanoidRootPart.CFrame.LookVector*1+player.Character.HumanoidRootPart.CFrame.RightVector*1
			local torso2 = _G.x.HumanoidRootPart.Position+_G.x.HumanoidRootPart.Velocity/10
			if h2 == 0 then
				local randomOffset = Vector3.new(math.random(-10, 10) / 15, math.random(-5, 5) / 15, math.random(-10, 10) / 15)
				torso2 = _G.x.HumanoidRootPart.Position+_G.x.HumanoidRootPart.Velocity/10 + randomOffset
			elseif h2 == 1 then
				torso2 = _G.x.HumanoidRootPart.Position+game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame.RightVector*(numba.Value/25)
			end
			bg.CFrame = CFrame.new(torso - Vector3.new(0,torso.y,0) ,torso2 - Vector3.new(0,torso2.y,0))

			_G.pos = _G.x["HumanoidRootPart"].Position+_G.x["HumanoidRootPart"].CFrame.RightVector*-1+_G.x.HumanoidRootPart.CFrame.LookVector*0+player.Character["HumanoidRootPart"].CFrame.RightVector*6

			if _G.x.HumanoidRootPart.Position.y-0.5 > player.Character.HumanoidRootPart.Position.y then
				delay(0,function() player.Character.Humanoid.Jump = true end)
			end

			if (_G.x["HumanoidRootPart"].Position-player.Character["HumanoidRootPart"].CFrame.p).magnitude <= 20 then
				if (_G.x["HumanoidRootPart"].Position-player.Character["Right Arm"].CFrame.p).magnitude <= 5 or hhh == true then
					hhh = true
					if (_G.x["HumanoidRootPart"].Position-player.Character["Right Arm"].CFrame.p).magnitude >= 7 then
						hhh = false
					end
					jo3 = jo3 + 1
					if jo3 >= math.random(2,4) then
						jo3 = 0
						if jo2 == 0 then
							jo2 = -2
						else
							jo2 = 0
						end
					end
					_G.pos = player.Character["HumanoidRootPart"].CFrame.LookVector*5*jo2+_G.x.HumanoidRootPart.Velocity/20
				end
				if player.Character:FindFirstChildOfClass("Tool") then
					player.Character:FindFirstChildOfClass("Tool"):Activate()
				end
			end
			player.Character.Humanoid:MoveTo(_G.pos)

		else
			bg.Parent = game.ReplicatedStorage
		end
	end)
end)

mouse = player:GetMouse()
_G.e = game:GetService("UserInputService").InputBegan:Connect(function(key)
	if key.KeyCode == Enum.KeyCode.R then
		if _G.y == 1 then
			_G.y = 0
			print("Off y")
			OrionLib:MakeNotification({
				Name = "Aimbot",
				Content = "Aimbot is now off",
				Image = "rbxassetid://4483345998",
				Time = 5
			})
		else
			_G.y = 1
			print("On y")
			OrionLib:MakeNotification({
				Name = "Aimbot",
				Content = "Aimbot is now on",
				Image = "rbxassetid://4483345998",
				Time = 5
			})	
			local succes, errorw  = pcall(function() end)
			if not succes then
				warn(errorw)
				error(errorw)
			end
		end

	elseif key.KeyCode == Enum.KeyCode.T then
		if _G.rage == 0 then
			_G.rage = 1
		else
			_G.rage = 0
		end
		OrionLib:MakeNotification({
			Name = "Rage Mode",
			Content = "Rage mode is now " .. (_G.rage == 1 and "on" or "off"),
			Image = "rbxassetid://4483345998",
			Time = 5
		})
	end
end)

while true do
	wait(0.1)
	if _G.rage == 1 and player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
		local point1 = player.Character.HumanoidRootPart.Position + Vector3.new(-40,-40,-40)
		local point2 = player.Character.HumanoidRootPart.Position + Vector3.new(40,40,40)
		local region = Region3.new(point1, point2)
		local parts = workspace:FindPartsInRegion3(region, player.Character, math.huge)

		local closestTarget = nil
		local closestDistance = math.huge

		for _, part in pairs(parts) do
			local model = part.Parent
			if model:FindFirstChild("Humanoid") and model:FindFirstChild("HumanoidRootPart") then
				if model.Humanoid.Health > 0 then
					local dist = (model.HumanoidRootPart.Position - player.Character.HumanoidRootPart.Position).Magnitude
					if dist < closestDistance then
						closestDistance = dist
						closestTarget = model
					end
				end
			end
		end

		if closestTarget then
			_G.x = closestTarget
			if _G.main then
				_G.main()
			end
		else
			_G.x = nil
		end
	end
end

Features & Information

R key - Activates the bot T key - Attacks people within 40x40 studs of your character (make sure enable rage mode so press T before activate bot) Credits to CerRexior I just edited his script and still making improvments
#Sword#Fight#Sword Fight#Sword Fight AI#Sword Fight Bot

Community Comments (3)

water_haxwater_haxAug 29, 2025

https://youtu.be/Mov3icl96rU?si=uezOFlC8KUYeNu5N

BurnsdeionBurnsdeionSep 16, 2025

Script doesn't even show up nor does it work thumbs down

Replying to @Burnsdeion
RobloxScrippterRobloxScrippterOct 28, 2025

@Burnsdeion fr

More Scripts for Universal Scripts