Run it
Copy the script and paste it into your executor.
en = :()
eo = :()
hb = :()
af = en.LocalPlayer
hc = (af:():())
ep = hc:()
ap = .()
ap.Name =
ap.ResetOnSpawn =
ap.IgnoreGuiInset =
ap.ZIndexBehavior = .ZIndexBehavior.Sibling
ap.Parent = af:()
l = .()
l.Size = .(, , , )
l.Position = .(, , , )
l.BackgroundColor3 = .(, , )
l.TextColor3 = .(, , )
l.Text =
l.Font = .Font.GothamBold
l.TextSize =
l.BorderSizePixel =
l.ZIndex =
l.Parent = ap
eq = .(); eq.CornerRadius = .(,); eq.Parent = l
co = .(); co.Color = .(,,); co.Thickness = ; co.Parent = l
di, er, bd = , ,
l.InputBegan:((ab)
ab.UserInputType == .UserInputType.MouseButton1 ab.UserInputType == .UserInputType.Touch
di = ; er = ab.Position; bd = l.Position
ab.Changed:(()
ab.UserInputState == .UserInputState.End di =
)
)
hb.InputChanged:((ab)
di (ab.UserInputType == .UserInputType.MouseMovement ab.UserInputType == .UserInputType.Touch)
d = ab.Position - er
l.Position = .(bd.X.Scale, bd.X.Offset + d.X, bd.Y.Scale, bd.Y.Offset + d.Y)
)
aq =
ar, ah, ai, as
o, w, j
be =
at = .(,,)
bf =
bg =
cp =
hd =
he =
cq =
hf =
bh =
u = .(,,)
cr = .(,,)
au = .(,,)
hg =
hh =
es =
hi =
et =
hj =
eu =
hk =
ev =
hl =
av =
cs =
bi =
hm =
aw =
bj =
bk =
hn =
ct =
ho =
aj =
bl =
cu =
bm =
hp =
hq =
hr =
bn =
ax =
dj =
ay =
bo =
bp =
ew =
ex =
hs =
ht =
ac =
ey =
ez =
fa =
fb =
dk = .()
dl = .()
dm =
dn =
fc =
fd =
dp =
dq =
cv =
cw =
dr =
hu =
hv =
bq = {}
hw =
ak = .pi
cx =
fe =
br =
bs =
bt =
ff = .(,,)
bv =
bw =
fg =
ag =
az =
hx = .()
bx =
ds =
by =
hy =
hz =
ia =
ib =
ic = {
{, },
{, },
}
bz =
dt = .(,,)
id =
ie = {
{, },
{, },
{, },
{, },
{, },
{, },
}
ca = RaycastParams.()
ca.FilterType = .RaycastFilterType.Exclude
(a, b) a + .() * (b - a)
(p) .() < p
(cy)
ba =
_, c (cy) ba = ba + c[]
r = .() * ba
du =
_, c (cy)
du = du + c[]
r <= du c[]
cy[#cy][]
ih = {
{, },
{, },
{, },
{, },
{, },
}
ii = {
{, },
{, },
{, },
}
fh = {
{.(,,-), },
{.(,,), },
{.(-,,), },
{.(,,), },
{.(-,,-).Unit, },
{.(,,-).Unit, },
{.(-,,).Unit, },
{.(,,).Unit, },
}
ij = {
{, },
{, },
{, },
{, },
}
fi = {
{, },
{, },
{, },
{, },
{, },
}
bb = {
{, },
{-, },
}
ik = {
{, },
{, },
}
il = {
{, },
{, },
}
cz =
da =
dv = {}
i=,cz
cb = (i-) * (*.pi/cz)
dv[i] = .(.(cb), , .(cb))
fj = {}
dw =
im =
io =
fk =
ip = .()
fl =
db =
iq =
ir =
is =
it =
dc =
cc =
fm =
fn =
()
ey = (, )
ez = (, )
fa = (, )
fb = (, )
dk = .((, ))
dl = .((, ))
dm = .() *
dn = .() *
fc = .() *
fd = .() *
dp = (, )
dq = .((, ))
()
ad = (ih)
ad ==
ak = .pi + (-, )
ad ==
ak = -.pi / + (-, )
ad ==
ak = -(.pi * ) + (-, )
ad ==
ak = -(.pi * ) + (-, )
ak = (-.pi, .pi)
cx = (, )
fe = (, )
(q)
t = .((q - et) / (hj - et), , )
es + (hi - es) * t + (-, )
(q)
t = .((q - ev) / (hl - ev), , )
b = eu + (hk - eu) * t
.(b + (-, ), , )
(f)
ac = ac + f
h = .(ac * ey + dm) * dk + .(ac * ez + dm * ) * dk *
v = .(ac * fa + dn) * dl + .(ac * fb + dn * ) * dl *
ix = .(ac * dp + fc) * dq
iy = .(ac * dp * + fd) * dq *
h + ix, v + iy
(v, cb)
c, s = .(cb), .(cb)
.(v.X*c - v.Z*s, , v.X*s + v.Z*c)
(al, am)
al - dw < im
dw = al
ca.FilterDescendantsInstances = am {o, am} {o}
i=,cz
x = :(j.Position, dv[i]*da, ca)
fj[i] = x (x.Position - j.Position).Magnitude da
(bc)
cd, fr = -.huge,
i=,cz
f = bc:(dv[i])
f > cd cd = f; fr = i
(fj[fr] da) / da
(bc, ce, dd, cf)
dx = bc:(ce)
jc = (bc)
jd = bc:(dd)
dy = cf bc:(cf)
dx*iq + jc*ir + jd*is + dy*it
(ft, cg, cf, fu, ch, dz, dd, q)
ft <= ,
fv = fu - cg
fw = .(fv.X, , fv.Z)
ce = fw.Magnitude > fw.Unit (cf .(,,))
ea, fx = -.huge, ce
b=, fk
je = (b - (fk+)/) * ip
eb = (ce, je)
an = (eb, ce, dd, cf)
jf = fu + ch * db + dz * ( * db * db)
jg = ch + dz * db
jh = (ft-, cg, eb, jf, jg, dz, dd, q * fl)
ba = an + q * fl * jh
ba > ea ea = ba; fx = eb
ea, fx
(cg, am, fy)
al = ()
jj = cv (fy.Position - cv).Magnitude > hv
cw jj (al - dr) < hu
cw
ca.FilterDescendantsInstances = {o, am}
ec, fz = , .huge
_, ao (am:())
ao:()
ch = ao.Position - cg
q = ch.Magnitude
q >
ed = bq[ao]
x
ed (al - ed.time) < hw
x = ed.result
x = :(cg, ch, ca)
bq[ao] = {result = x, time = al}
an
x ==
an = q
x.Instance x.Instance:(am)
an = q *
an = q *
an < fz
fz = an
ec = (x x.Instance x.Instance:(am)) x.Position ao.Position
p (bq)
p.Parent bq[p] =
cv = fy.Position
cw = ec
dr = al
ec
(de)
ai ai:(); ai =
de
ai = de.Activated:(()
cp
cp =
c = de.Parent
k = c c:()
h = c c:()
k h h.Health <= cp =
df = h:(de:() .())
df:()
ee = OverlapParams.()
ee.FilterDescendantsInstances = {c}
ee.FilterType = .RaycastFilterType.Exclude
ae = .()
ae.Size = .(cq, cq, cq)
ae.Shape = .PartType.Ball
ae.CFrame = k.CFrame * .(, , -(cq / ))
ae.Anchored = ; ae.CanCollide = ; ae.Transparency =
ae.Parent =
dx = :(ae, ee)
ae:()
ga = {}
_, ao (dx)
ad = ao:()
ad ga[ad]
ef = ad:()
ef ef.Health >
ga[ad] =
ef:(he)
.(hd, () cp = )
)
()
o = af.Character
o
w = o:()
j = o:()
w ~= j ~=
()
.()
()
t = af.Backpack:()
t w:(t); (t)
()
ah ah:(); ah =
o
t = o:()
t
ah = t.Unequipped:(()
aq ()
)
()
j
g = j:()
g
g = .()
g.Name =
g.MaxTorque = .(, , )
g.P = ; g.D =
g.CFrame = j.CFrame
g.Parent = j
g
()
j
g = j:()
g g:()
()
j
ge, cd = , .huge
_, p (en:())
p ~= af p.Character
gf = p.Character:()
gg = p.Character:()
gf gg gg.Health >
d = (gf.Position - j.Position).Magnitude
d < cd cd = d; ge = p.Character
ge
(f)
aq
o j w
gh = ()
gh
eh = gh:()
eh
bz = bz - f
bz <=
bz = id
gi = .(eh.Position.X - j.Position.X, , eh.Position.Z - j.Position.Z)
ci = gi.Magnitude > gi.Unit .(,,)
dg = ci:(.(,,))
cj = (ie)
aa
cj == aa = -dg
cj == aa = dg
cj == aa = ci
cj == aa = -ci
cj == aa = (ci - dg)
aa = (ci + dg)
aa.Magnitude > aa = aa.Unit
dt = (aa, (-, ))
w:(dt, )
(f)
()
ck = ()
ck
w:(.(,,))
bh =
u = .(,,)
cr = .(,,)
au = .(,,)
dc =
ag =
k = ck:()
gj = ck:()
k
q = (k.Position - j.Position).Magnitude
ei = .(k.Position.X - j.Position.X, , k.Position.Z - j.Position.Z)
n = ei.Magnitude > ei.Unit .(,,)
gk = .(,,)
bh f > gk = (k.Position - bh) / f
bh = k.Position
u = u:(gk, hg)
jp = f > (u - cr) / f .(,,)
cr = u
au = au:(jp, hh)
ej = u - n * u:(n)
jq = ej.X * n.Z - ej.Z * n.X
gl = jq >= -
cs ~= gl ~= cs ej.Magnitude >
bi =
cs = gl
bi = .(, bi - f * hm)
gm = .(u.X, , u.Z).Magnitude
aw ct > gm < ct * ho
aw = ; bj = hn; bk = k.Position
ct = gm
aw
bj = bj - f
bj <= aw = ; bk =
jr = gj gj.FloorMaterial == .Material.Air
js = .(, -.Gravity, )
cl = (q)
cm
aw bk
cm = bk
cm = k.Position + u * cl + au * ( * cl * cl)
jr cm = cm + js * ( * cl * cl)
cx = cx - f
cx <= ()
z = .(k.CFrame.LookVector.X, , k.CFrame.LookVector.Z)
z.Magnitude < z = -n z = z.Unit
ek = .(z.Z, , -z.X).Unit
ag
jt = ag.X*z.Z - ag.Z*z.X
ju = ag.X*z.X + ag.Z*z.Z
jv = .(jt, ju)
az = az + jv
.(az) >= hx
jw = az > -
az =
(ic)
jx = -ek
jy = ek
gn = jw > jx jy
go = k.Position + gn * (ia, ib)
gp = .(go.X - j.Position.X, , go.Z - j.Position.Z)
ds = gp.Magnitude > gp.Unit gn
bx =
by = (hy, hz)
ag = z
gq = (-z * .(ak) + ek * .(ak)) * fe
gr = .(k.Position.X + gq.X, j.Position.Y, k.Position.Z + gq.Z)
gs = .(gr.X - j.Position.X, , gr.Z - j.Position.Z)
gt = gs.Magnitude > gs.Unit n
bt = bt - f
br
bs = bs - f
bs <= br = ; bt = (, )
bt <= ()
br =
bs = (, )
ff = (n + .((bb) * (, ), , )).Unit
bw = bw - f
bv bw <= bv =
by = by - f
bx by <= bx =
be = be - f
bf = bf - f
y
br
y = ff
bx
y = ds
bv
jz = .(-n.Z, , n.X) * fg
y = (n * + jz * ).Unit
bf > bg
y = bg
bg =
be <=
be = (, )
el = (ii)
el ==
df = (, .pi * )
at = .(.(df), , .(df))
el ==
bv = ; bw = (, )
fg = (bb)
at = (fh)
at = (fh)
(ik) w.FloorMaterial ~= .Material.Air
w.Jump =
(il)
gu = .(-n.Z, , n.X)
bg = (bb) > gu -gu
bf = (, )
ka = .(n.Z, , -n.X)
dh = n * -at.Z + ka * at.X
dh.Magnitude > dh = dh.Unit
gv = .((q - ) / , , )
y = dh * ( - gv) + gt * gv
y.Magnitude > y = y.Unit
gw = .(u.X, , u.Z)
gw.Magnitude > y.Magnitude >
dy = gw.Unit:(y)
dy >
aj = aj + hp * f
aj = .(, aj - hq * f)
aj >= hr bl
bl = ; bm = ; aj =
gx = .(-n.Z, , n.X)
cu = (bb) > gx -gx
bl
y = cu
bm = bm + f
bm >= (, ) bl = ; cu =
w:(y, )
bn = bn - f
bn <= ax
ax = ; ay =
dj = (hs, ht)
bo = (bb) * .((fi))
bp = (ij)
bn = (ew, ex)
ax
ay = ay + f
ay >= dj
ax =
bp >
bp = bp -
ax = ; ay =
dj = (, )
bo = (bb) * .((fi))
bo =
cc = cc - f
cc <=
()
cc = (fm, fn)
kb = (j.Position, ck, k) k.Position
kc = cm - k.Position
kd = kb + kc
((), ck)
_, gy = (io, j.Position, dc, kd, u, au, gt, )
dc = gy
ke = .(, (q) + bi * )
gz = .(j.Position, j.Position + gy * )
av av = gz
av = av:(gz, ke)
kf, kg = (f)
kh = av * .(kg, kf + bo, )
ha = ()
ha ha.CFrame = kh
ei.Magnitude <= hf
em = o:()
em em.Parent == o
(() em:() )
()
()
bh =
u = .(,,)
cr = .(,,)
au = .(,,)
cs = ; bi =
aw = ; bj = ; bk =
ct =
aj = ; bl = ; cu = ; bm =
bf = ; bg =
bn = (ew, ex)
ax = ; bo = ; ay = ; bp =
cv = ; cw = ; dr =
bq = {}
av =
ac =
cc = (fm, fn)
()
()
br = ; bs = ; bt =
bv = ; bw =
dc =
dw =
ag = ; az =
bx = ; ds = ; by =
bz = ; dt = .(,,)
(cn)
aq = cn
l.Text = cn
l.BackgroundColor3 = cn .(,,) .(,,)
co.Color = cn .(,,) .(,,)
be =
()
cn
ep:()
()
ar ar:()
ar = eo.Heartbeat:((f)
aq
(jo, f)
)
as as:()
as = eo.Heartbeat:((f)
(jn, f)
)
ar ar:(); ar =
as as:(); as =
ah ah:(); ah =
ai ai:(); ai =
ep:()
()
w w:(.(,,))
l.MouseButton1Click:(() ( aq) )
af.CharacterAdded:((c)
o = c
w = c:()
j = c:()
aq
.()
()
()
)
af.Character
o = af.Character
w = o:()
j = o:()
The AI behaves like an aggressive, predictive sword fighter. It constantly searches for the nearest living opponent and follows them as its main target. Instead of simply moving toward the opponent's current position, it watches how the opponent is moving and estimates their velocity and acceleration. It uses that information to predict where the opponent will be shortly, then moves and aims toward that predicted position. The AI tries to avoid moving in a completely straight line. It constantly changes its footwork using randomized behaviors such as strafing, circling, moving behind the opponent, moving to the side, moving diagonally, briefly hesitating, spinning, jumping, and suddenly changing direction. It has preferred attack-positioning behaviors. It often tries to get behind or beside the opponent instead of staying directly in front of them. Its preferred position is randomized, so its movement does not always look identical. The AI watches the opponent's movement and can react when the opponent suddenly slows down, changes direction, or turns. When this happens, it can temporarily change its movement pattern or reposition to another side. It also checks the surroundin