Run it
Copy the script and paste it into your executor.
CONFIG = {
DETECTION_RADIUS = ,
ALLOW_HEALING = ,
HEALING_BELOW_HEALTH = ,
IMMEDIATE_ATTACK_RADIUS = ,
SWORD_NAME = ,
HEALING_PAD_POSITIONS = {
.(-, , ),
.(, , ),
},
DIST_SWING = ,
CHARGE_NO_JUMP_DIST = ,
START_COMBAT = ,
FLING_RESET_DISTANCE = ,
NODEWALK_SPEED = ,
PATHFIND_SPEED = ,
PREDICT_PLAYER_HIT = ,
PREDICT_PLAYER_DIST = ,
USE_PREDEFS_ON_NOPATH = ,
PATCH_HUMANOID_MOVE_QUIRKS = ,
CURRENT_DIFFICULTY = ,
DEBUG = ,
DEBUG_NODEWALKER = ,
DEBUG_PATHFIND_OPEN = ,
}
CARDINALS = {
.xAxis, .zAxis, -.xAxis, -.zAxis,
.(, , ), .(-, , ), .(-, , -), .(, , -),
}
VEC3XZ = .(, , )
HUM_STATES_SHIFTLOCK = {, , , , }
RunService = :()
Players = :()
:() .Loaded:()
Player = Players.LocalPlayer
(char, back, name)
char back
_,v char:()
v:() v.Name == name
v
_,v back:()
v:() v.Name == name
v
DebugPart = .()
DebugPart.Anchored =
DebugPart.CanCollide =
DebugPart.CanQuery =
DebugPart.CanTouch =
DebugPart.Transparency =
DebugPart.Size = .one
DebugPart.Name =
DebugPart.Parent = .Terrain
DebugPart.CFrame = .identity
DebugWireframe = .()
DebugWireframe.Color3 = .(, , )
DebugWireframe.Adornee = DebugPart
DebugWireframe.AlwaysOnTop =
DebugWireframe.Parent = DebugPart
DebugNodewalker = .()
DebugNodewalker.Color3 = .(, , )
DebugNodewalker.Adornee = DebugPart
DebugNodewalker.AlwaysOnTop =
DebugNodewalker.Parent = DebugPart
DebugPathfinder = .()
DebugPathfinder.Color3 = .(, , )
DebugPathfinder.Adornee = DebugPart
DebugPathfinder.AlwaysOnTop =
DebugPathfinder.Parent = DebugPart
DebugController = .()
DebugController.Color3 = .(, , )
DebugController.Adornee = DebugPart
DebugController.AlwaysOnTop =
DebugController.Parent = DebugPart
DebugBrain = .()
DebugBrain.Color3 = .(, , )
DebugBrain.Adornee = DebugPart
DebugBrain.AlwaysOnTop =
DebugBrain.Parent = DebugPart
(wf)
CONFIG.DEBUG
wf:()
(wf, pos)
CONFIG.DEBUG
p, seg, r = {}, , + .(.() * + (pos.X + pos.Y + pos.Z) * ) *
i = , seg
a = (i / seg) * .pi *
p[#p + ] = pos + .(.(a)*r, , .(a)*r)
wf:(p, )
(wf, pos, r)
CONFIG.DEBUG
p, seg = {}, .( + (r // ), )
i = , seg
a = (i / seg) * .pi *
p[#p + ] = pos + .(.(a)*r, , .(a)*r)
wf:(p, )
(wf, pos)
CONFIG.DEBUG
seg, h = , + .(.() * ) *
pos += .yAxis * h
i = , seg
a = (i / seg) * .pi *
b = ((i + ) / seg) * .pi *
wf:(pos + .(.(a) * , , .(a) * ), pos + .(.(b) * , , .(b) * ))
wf:(pos + .(.(a) * , , .(a) * ), pos)
(wf, a, b)
CONFIG.DEBUG
wf:(a, b)
(wf, pos, txt)
CONFIG.DEBUG
wf:(pos, txt, )
DebugLines = {
,
,
,
,
,
,
,
,
,
}
RunService.PreRender:(()
.CurrentCamera
DebugWireframe:()
DebugWireframe:(.CurrentCamera.Focus.Position, .(DebugLines, ), )
)
.()
Characters = {}
CharactersFF = {}
AntiflingHumanoids = {}
AntiflingBaseParts = {}
RunService.PreAnimation:(()
i,v Characters
v:()
.(CharactersFF, v) .(CharactersFF, v)
j = .(CharactersFF, v)
j .(CharactersFF, j)
v:()
.(Characters, i)
j = .(CharactersFF, v)
j .(CharactersFF, j)
i,v AntiflingBaseParts
v:()
v.CanCollide =
.(AntiflingBaseParts, i)
i,v AntiflingHumanoids
v:()
v.EvaluateStateMachine =
.(AntiflingHumanoids, i)
)
OnBasePart = (v)
v:()
v.CanCollide =
.(AntiflingBaseParts, v)
.(AntiflingBaseParts, v)
v:()
v.EvaluateStateMachine =
.(AntiflingHumanoids, v)
.(AntiflingHumanoids, v)
OnCharacter = (character)
.(Characters, character)
character.DescendantAdded:(OnBasePart)
_,v character:()
(v)
OnPlayer = (player)
player == Player
player.CharacterAdded:((character)
.(Characters, character)
)
player.Character .(Characters, player.Character)
player.CharacterAdded:(OnCharacter)
player.Character (player.Character)
Players.PlayerAdded:(OnPlayer)
_,player Players:()
(player)
(value)
value
value ~= value
(value) ==
value.Magnitude >
(vec, dir)
dir.Magnitude == dir
dir * dir:(vec)
CollideForcers = {}
_,v :()
v.Name == v:()
w = v:()
w.Parent = v
w.Name ..=
w.CanCollide =
w.Transparency =
.(CollideForcers, w)
RCP = RaycastParams.()
RCP.FilterType = .RaycastFilterType.Exclude
RCP.RespectCanCollide =
RCP.IgnoreWater =
OVP = OverlapParams.()
OVP.FilterType = .RaycastFilterType.Exclude
OVP.RespectCanCollide =
RunService.PreAnimation:(()
RCP.FilterDescendantsInstances = Characters
OVP.FilterDescendantsInstances = Characters
)
(origin, direction)
:(origin, direction, RCP)
(origin, size, direction)
:(origin, size, direction, RCP)
(origin, radius, direction)
:(origin, radius, direction, RCP)
(cf, size)
:(cf, size, OVP)
(cf, size)
#(cf, size) >
(origin, boxsize, direction)
#(
.(origin, direction) * .(, , -direction / ),
.(boxsize * , boxsize * , direction.Magnitude)
) >
(position, downwarped)
radius =
direction = .(, -, )
downwarped direction *=
position += .(, + radius, )
cast = (position, radius, direction)
cast
position + direction.Unit * (cast.Distance + radius), cast.Instance
(position, downwarped)
direction = .(, -, )
downwarped direction *=
position += .(, , )
cast = (position, direction)
cast
cast.Position, cast.Instance
(pos)
(pos, , .(, -, ))
(a, b)
a = (a)
a
b = (b)
b
.(a.Y - b.Y) >
diff = b - a
diff == .zero
dist = diff.Magnitude
dist >
(b)
(a + .(, , ), , diff)
dir = diff.Unit
step =
i=, dist, step
(a + dir * i)
AINodes = {}
AINodesMap = {}
AINodesDyn = {}
AINodesCount =
AINodesDynCount =
(pos)
.(
.(pos.X) + ,
pos.Y,
.(pos.Z) +
)
GetNodeCost_cache = {}
(node)
GetNodeCost_cache[node]
cost =
result = (node.Position, .(, -, ))
result
result.Instance.Transparency >
cost =
cost =
result = (node.Position, .(, , ))
result
cost /= .(, result.Distance / )
GetNodeCost_cache[node] = cost
GetNodeCost_cache[node]
(a, b)
((b.Position - a.Position) * VEC3XZ).Magnitude
(a, b)
.(a.Nearby, b) .(a.Nearby, b)
.(b.Nearby, a) .(b.Nearby, a)
(a, b)
.(a.Links, b) .(a.Links, b)
.(b.BackLinks, a) .(b.BackLinks, a)
(a, b)
i = .(a.Links, b)
i .(a.Links, i)
i = .(b.Links, a)
i .(b.Links, i)
i = .(a.BackLinks, b)
i .(a.BackLinks, i)
i = .(b.BackLinks, a)
i .(b.BackLinks, i)
(node)
_,v node.Links (node, v)
_,v node.BackLinks (node, v)
(x, z)
x, z = .(x), .(z)
AINodes[x]
AINodes[x][z]
(pos)
node, node2 = AINodes,
fx, fz = .(pos.X), .(pos.Z)
k = fx
node2 = node[k]
node2
node2 = {}
node[k] = node2
node = node2
k = fz
node2 = node[k]
node2
node2 = {}
node[k] = node2
node = node2
k = .(pos.Y)
node2 = node[k]
node2
node2 = {}
node[k] = node2
node2.Explored =
node2.Known =
node2.Dynamic =
node2.Links = {}
node2.BackLinks = {}
node2.Index = #AINodesMap +
pos = (pos)
node2.Nearby = {}
x = fx - , fx +
z = fz - , fz +
x == fx z == fz
(x, z)
_,node3 AINodes[x][z]
(node2, node3)
y = k
poz, ground = (pos)
poz
y = poz.Y +
ground ground:() ground:()
node2.Dynamic =
node2.YLevel = pos.Y
node2.Position = .(pos.X, y, pos.Z)
node2.Ground = ground
.(AINodesMap, node2)
AINodesCount +=
node2.Dynamic
.(AINodesDyn, node2)
AINodesDynCount +=
node = node2
node
(pos)
n, d = ,
_,node AINodesMap
d2 = (pos - node.Position).Magnitude
d2 < d
d = d2
n = node
n
(pos)
pos
pos = (pos)
(.(pos + .(, , )), .(, , ))
(.(pos + .(, -, )), .(, , ))
AINodeWalkers = {}
(pos)
result = ((pos + .(, , )), .(, -, ))
result
result.Position, result.Distance >
,
(pos, dir, node)
dir = dir .zero
poz = pos + dir
node node.Dynamic
(poz.X, poz.Z)
newpos, oneway = (poz)
(newpos)
cangoto = (pos + .(, , ), , (newpos - pos) * VEC3XZ)
cangoto
newnode = (newpos)
node
(node, newnode)
oneway (newnode, node)
newnode.Known
newnode.Known =
.(AINodeWalkers, newnode)
(node)
CONFIG.DEBUG_NODEWALKER (DebugNodewalker, node.Position)
_,dir CARDINALS
(node.Position, dir, node)
(node.Position, dir * , node)
(node.Position, dir * , node)
(node)
node.Explored
(node)
node.Explored =
(.(, , ))
Heap = {}
Heap.(fScore)
self = {
data = {},
fScore = fScore
}
(t, a, b)
t[a], t[b] = t[b], t[a]
self.(self, node)
.(self.data, node)
i = #self.data
i >
parent = .(i / )
self.fScore[self.data[i]] < self.fScore[self.data[parent]]
(self.data, i, parent)
i = parent
self.(self)
#self.data ==
root = self.data[]
last = .(self.data)
#self.data >
self.data[] = last
i =
left = i *
right = left +
smallest = i
left <= #self.data
self.fScore[self.data[left]] < self.fScore[self.data[smallest]]
smallest = left
right <= #self.data
self.fScore[self.data[right]] < self.fScore[self.data[smallest]]
smallest = right
smallest ~= i
(self.data, i, smallest)
i = smallest
root
self.(self)
#self.data ==
self.(self)
#self.data
self
(a, b)
(a + .(, , ), b - a)
aGround = (a + .(, , ), .(, -, ))
bGround = (b + .(, , ), .(, -, ))
aGround bGround
aGround.Instance == bGround.Instance
(path)
i =
i <= #path -
a = path[i]
c = path[i + ]
(a.Position, c.Position)
.(path, i + )
i +=
(start, goal)
DebugLines[] =
startnode = (start)
startnode
(start)
goalnode = (goal)
goalnode
(goal)
DebugPathfinder.Color3 = .(, , )
cameFrom = {}
gScore = {}
fScore = {}
costScan = {}
gScore[startnode] =
fScore[startnode] = (startnode, goalnode)
costScan[startnode] = (startnode)
openSet = Heap.(fScore)
openSet:(startnode)
iter =
openSet:()
DebugLines[] = .. openSet:()
iter +=
iter >= CONFIG.PATHFIND_SPEED
.()
iter =
(DebugPathfinder)
(DebugPathfinder, start)
(DebugPathfinder, goal)
current = openSet:()
current == goalnode
DebugPathfinder.Color3 = .(, , )
path = {}
current
.(path, , {
Position = current.Position,
Cost = costScan[current],
Node = current,
})
current = cameFrom[current]
(path)
DebugLines[] = .. #path ..
(DebugPathfinder)
(DebugPathfinder, start)
(DebugPathfinder, goal)
i=, #path
(DebugPathfinder, path[i].Position)
(DebugPathfinder, path[i].Position + .(, , ), (path[i].Cost))
path[i - ]
(DebugPathfinder, path[i - ].Position, path[i].Position)
path
CONFIG.DEBUG_PATHFIND_OPEN (DebugPathfinder, current.Position)
_,neighbor current.Links
cost = (neighbor)
cost >
tentative = gScore[current] + cost * (current, neighbor)
gScore[neighbor] tentative < gScore[neighbor]
cameFrom[neighbor] = current
gScore[neighbor] = tentative
fScore[neighbor] = tentative + (neighbor, goalnode)
costScan[neighbor] = cost
openSet:(neighbor)
(DebugPathfinder)
DebugLines[] =
.(()
iter =
node = AINodeWalkers[]
node
DebugLines[] = .. #AINodeWalkers .. .. AINodesCount
iter +=
iter >= CONFIG.NODEWALK_SPEED
.()
(DebugNodewalker)
iter =
_,v CollideForcers v.CanCollide =
(node)
.(AINodeWalkers, )
(DebugNodewalker)
DebugLines[] = .. AINodesCount .. .. AINodesDynCount ..
_,v CollideForcers v.CanCollide =
.()
)
.(()
dyn =
.()
RunService.PreSimulation:()
t = .()
GetNodeCost_cache = {}
_,node AINodesDyn
ceiling = node.Position * VEC3XZ + .yAxis * (node.YLevel + )
downward = (ceiling, .(, -, ))
downward downward.Normal.Y >
node.Position = (downward.Position + .(, , ))
node.Ground = downward.Instance
node.Ground =
AINodesDynCount >
node = AINodesDyn[dyn]
dyn = (dyn % AINodesDynCount) +
(node)
(node)
_,node2 node.Nearby
node.Position.Y > node2.Position.Y -
(node, node2)
node2.Position.Y > node.Position.Y -
(node2, node)
)
Player.DevComputerMovementMode = .DevComputerMovementMode.Scriptable
Player.DevTouchMovementMode = .DevTouchMovementMode.Scriptable
(pos, dist)
nearest =
nearestdist = dist
_,char Characters
char ~= Player.Character char:()
hum = char:()
root = char:()
root hum hum.Health > (root.Position)
dist = ((root.Position + root.Velocity * CONFIG.PREDICT_PLAYER_HIT - pos) * VEC3XZ).Magnitude
dist <= nearestdist
nearest = root
nearestdist = dist
nearest, nearestdist
Difficulties = {
{
REACH = ,
EXTRASPEED = ,
},
{
REACH = ,
EXTRASPEED = ,
},
{
REACH = ,
EXTRASPEED = ,
},
}
()
W, L = ,
Player:()
Player.leaderstats:()
W = Player.leaderstats.KOs.Value
Player.leaderstats:()
L = Player.leaderstats.Wipeouts.Value
()
char = Player.Character
back = Player:()
char back
hum = char:()
root = char:()
hum root hum:().Name ~=
(root.Position) root.Position.Magnitude < CONFIG.FLING_RESET_DISTANCE
char, back, hum, root
(hum.ServerBreakJoints)
targetMove = idlePosition
targetLook = .zero
targetLookY =
targetJump =
haveSword =
useSword =
overrideController =
noPathEvent =
.(()
(pf)
path = (pf.Start, pf.Goal)
pf.Done =
pf.Path = path {}
path noPathEvent
(pf.Goal)
pathfinding =
pathfinding2 =
moveToward =
dt = .()
(DebugController)
overrideController
DebugLines[] =
DebugLines[] =
DebugLines[] =
char, back, hum, root = ()
char
lleg, rleg = char:(), char:()
lleg lleg.CanCollide =
rleg rleg.CanCollide =
char:()
sword = (char, back, CONFIG.SWORD_NAME)
sword
haveSword
DebugLines[] =
sword.Parent == back sword.Parent = char
useSword .() < * dt
DebugLines[] =
sword.Enabled =
sword:()
DebugLines[] =
sword.Parent == char sword.Parent = back
DebugLines[] =
DebugLines[] =
targetLook .(HUM_STATES_SHIFTLOCK, hum:().Name)
diff = (targetLook - root.Position) * VEC3XZ
diff.Magnitude >
root.CFrame = .(root.CFrame.Position, diff) * .(, targetLookY, )
root.RotVelocity = .zero
onLadder = hum:() == .HumanoidStateType.Climbing
onGround = hum:() == .HumanoidStateType.Running onLadder
moveDir = .zero
mePos = (root.Position, ) root.Position
targetMove = (targetMove) ((targetMove, ) targetMove)
mePos targetMove
(DebugController, mePos)
(DebugController, targetMove)
(mePos, targetMove)
DebugLines[] =
pathfinding2 =
moveToward = targetMove
DebugLines[] =
pathfinding pathfinding ~=
pathfinding.Done
pathfinding2 = pathfinding
pathfinding =
moveToward
path = pathfinding2.Path
closestDist =
i=, #path
dist = (moveToward - path[i].Position).Magnitude
dist < closestDist
closestDist = dist
pathfinding2.Index = i
DebugLines[] =
pathfinding == pathfinding2
pf = {}
pf.Start = mePos
pathfinding2
pf.Start = moveToward
pf.Goal = targetMove
pf.Index =
pf.Path = {}
pf.Done =
.(PfThread, pf)
pathfinding = pf
DebugLines[] =
pf = pathfinding2
pf #pf.Path >= pf.Index
path = pathfinding2.Path
i=,
wp = path[pf.Index + i]
lwp = path[pf.Index + i - ]
nwp = path[pf.Index + i + ]
wp
(DebugController, wp.Position)
(wp.Node) ~= wp.Cost
pathfinding = pathfinding
nwp ((nwp.Position + wp.Position) / )
onGround
((wp.Position - mePos) * VEC3XZ).Magnitude <
pf.Index += i +
(pathfinding2.Goal - targetMove).Magnitude >
pathfinding = pathfinding
path[pf.Index] (path[pf.Index].Position)
DebugLines[] = .. pf.Index
moveToward = path[pf.Index].Position
moveToward.Y > mePos.Y + pf.Index >
pf.Index -=
pathfinding2 =
moveToward
(DebugController, moveToward + .(, , ))
diff = (moveToward - mePos) * VEC3XZ
onGround
diff *=
diff *=
diff.Magnitude >
moveDir = diff.Unit
moveDir = diff
DebugLines[] =
mustJump = targetJump
onGround onLadder
DebugLines[] =
dir = root.Velocity * VEC3XZ
mustJump
DebugLines[] =
dir.Magnitude > (root.CFrame, .(, , ))
mustJump =
DebugLines[] =
mustJump
dir.Magnitude >
check1 = (root.CFrame + dir.Unit * + .(, -, ), .(, , ))
check2 = (root.CFrame + dir.Unit * + .(, -, ), .(, , ))
check3 = (root.CFrame + dir.Unit * + .(, -, ), .(, , ))
check1 check2
check3
mustJump =
DebugLines[] =
moveDir = .zero
pathfinding2 =
DebugLines[] =
(DebugController, root.Position, root.Position + moveDir * )
hum:(moveDir)
CONFIG.PATCH_HUMANOID_MOVE_QUIRKS onLadder
vel = root.Velocity
tvel = moveDir * VEC3XZ * hum.WalkSpeed + .yAxis * vel.Y
onGround
vel = tvel:(vel, .(- * dt))
vel = tvel:(vel, .(- * dt))
root.Velocity = vel
mustJump onGround
hum:(.HumanoidStateType.Jumping)
DebugLines[] =
DebugLines[] =
DebugLines[] =
moveToward =
pathfinding =
pathfinding2 =
)
charge =
.(()
.(.() * )
charge = charge
)
strafe =
strafe2 =
.(()
strafe2 = .(-, )
.() <
strafe = -strafe
_=, .() *
strafe = -strafe
.( / )
.(.() * )
)
backoff =
.(()
.(.() * )
backoff = .(, )
)
idlePosition =
chargeJump =
Playstyles = {
(dt, hum, root, victim, dist, hitDist, mePos, mePosGround, victimPos, victimCF)
vpos = victimPos
vcf = .(.zero, (victimPos - mePos) * VEC3XZ)
dist > CONFIG.PREDICT_PLAYER_DIST victim.Velocity.Magnitude >
voff = victim.Velocity * CONFIG.PREDICT_PLAYER_HIT * VEC3XZ
vpos += voff
dist < CONFIG.IMMEDIATE_ATTACK_RADIUS
charge =
closest =
victim.Position.Y < mePos.Y -
closest =
dist >
targetLook = vpos
targetLook = victimPos
lookYDist = (targetLook - mePos).Magnitude
lookYDist >
targetLookY = .( / lookYDist)
targetLookY = .pi *
goingTo = -victim.Velocity.Unit:(vcf.LookVector)
goingToR = victim.Velocity.Unit:(vcf.RightVector)
swordDir = victimCF:(.(, , -).Unit)
vdist = ((vpos - mePos) * VEC3XZ).Magnitude
targetJump = victim.Velocity.Y >
victim.Velocity.Magnitude > (mePosGround, victimPos)
tight =
_,v CARDINALS
(victimPos + v * )
tight +=
(DebugBrain, victimPos + v * )
tight >
DebugLines[] =
targetMove = vpos + vcf:(.(strafe, , backoff))
(targetMove * VEC3XZ + mePosGround * .yAxis)
charge =
strafe2 =
DebugLines[] =
goingTo >
charge =
vcf.RightVector:(swordDir) + goingToR * >
strafe2 = -
strafe2 =
.(goingToR) >
closest =
DebugLines[] =
goingTo < -
charge =
strafe2 =
closest =
DebugLines[] =
charge
vdist > CONFIG.CHARGE_NO_JUMP_DIST goingTo >
.() - chargeJump >
chargeJump = .()
targetJump =
targetMove = mePosGround + vcf:(.(strafe2, , closest - dist))
DebugLines[] =
targetMove = vpos + vcf:(.(, , backoff))
goingTo >
charge =
DebugLines[] =
charge
vdist > + goingTo * dist >
targetJump =
targetMove = vpos + vcf:(.(, , closest))
DebugLines[] =
vdist > CONFIG.CHARGE_NO_JUMP_DIST goingTo >
targetJump =
targetMove = vpos + vcf:(.(strafe2, , closest))
(hum:() == .HumanoidStateType.Running targetJump) dist < CONFIG.DIST_SWING hitDist <
useSword =
targetLookY += .pi * * (.() - ) *
,
(dt, hum, root, victim, dist, hitDist, mePos, mePosGround, victimPos, victimCF)
vpos = victimPos + (victim.Velocity * CONFIG.PREDICT_PLAYER_HIT)
dist <=
vpos = victimPos
dist < dist >
targetJump =
dist < CONFIG.IMMEDIATE_ATTACK_RADIUS
charge =
diff = (victim.Position - root.Position) * VEC3XZ
currentDist = diff.Magnitude
targetLook = vpos
lookat = .(.zero, (vpos - root.Position) * VEC3XZ)
lookat2 = .(.zero, (victim.Position - root.Position) * VEC3XZ)
victim.Velocity.Magnitude > (mePosGround, victimPos)
charge
targetJump =
currentDist >=
DebugLines[] =
targetMove = vpos + lookat:(.(, , ))
DebugLines[] =
strafe = lookat2:(.(.(() * ) * , , -))
targetMove = vpos + strafe
targetLookY = .pi * * (.() - )
DebugLines[] =
targetMove = vpos + lookat:(.(strafe2, , ))
DebugLines[] =
targetMove = vpos + lookat:(.(, , ))
targetLookY = .pi * * (.() - )
(DebugBrain, targetMove)
targetLookY = .pi *
(targetMove, .(, -, ))
DebugLines[] =
targetMove = vpos + lookat:(.(, , ))
dist < + Player:() + CONFIG.DIST_SWING
useSword =
,
(dt, hum, root, victim, dist, hitDist, mePos, mePosGround, victimPos, victimCF)
vpos = victimPos
vcf = .(.zero, (victimPos - mePos) * VEC3XZ)
dist > CONFIG.PREDICT_PLAYER_DIST
voff = victim.Velocity * CONFIG.PREDICT_PLAYER_HIT * VEC3XZ
vpos += voff
dist < CONFIG.IMMEDIATE_ATTACK_RADIUS
charge =
closest =
victim.Position.Y < mePos.Y -
closest =
targetLook = victimPos
lookYDist = (targetLook - mePos).Magnitude
lookYDist >
targetLookY = .( / lookYDist)
targetLookY = .pi *
targetJump = victim.Velocity.Y >
victim.Velocity.Magnitude > (mePosGround, victimPos)
DebugLines[] =
targetMove = mePosGround + vcf:(.(strafe * , , (backoff - dist) / )) + victim.Velocity /
vcf.LookVector:(victim.Velocity.Unit) <
charge =
charge
dist > CONFIG.CHARGE_NO_JUMP_DIST
targetJump =
DebugLines[] =
targetMove = mePosGround + vcf:(.(strafe2, , -))
DebugLines[] =
targetMove = vpos + vcf:(.(strafe2, , closest))
(hum:() == .HumanoidStateType.Running targetJump) dist < CONFIG.DIST_SWING hitDist <
useSword =
targetLookY += .pi * * (.() - ) *
,
}
PlaystylesNames = {
,
,
,
}
PlaystylesDeaths = {}
_,_ PlaystylesNames .(PlaystylesDeaths, )
()
low, lowv, high, highv = , .huge, ,
i,v PlaystylesDeaths
v <= lowv
low, lowv = i, v
v >= highv
high, highv = i, v
low high
diff = highv - lowv
diff >
.() > / diff
low
.(#Playstyles)
(i)
PlaystylesDeaths[i] +=
currentVictim =
currentPlaystyle =
currentPlaystyleName =
currentPlaystyleIndex =
dt = .()
charge
DebugLines[] =
DebugLines[] =
(DebugBrain)
char, back, hum, root = ()
char
DebugLines[] =
DebugLines[] =
targetMove =
targetLook =
targetLookY =
targetJump =
haveSword =
useSword =
overrideController
DebugLines[] =
.() < * dt
idlePosition =
idlePosition
dir = .(, .() * .pi * , ).LookVector * .(, )
hit = (root.Position + dir + .(, , ), .(, -, ))
hit
idlePosition = hit.Position
targetMove = idlePosition
distanceToEngage = CONFIG.DETECTION_RADIUS
CONFIG.ALLOW_HEALING
hum.Health < CONFIG.HEALING_BELOW_HEALTH
distanceToEngage = CONFIG.START_COMBAT
healpad, healdist = , .huge
_,v CONFIG.HEALING_PAD_POSITIONS
dist = ((v - root.Position) * VEC3XZ).Magnitude
dist < healdist
healpad = v
healdist = dist
healpad
targetMove = healpad
targetJump =
DebugLines[] =
DebugLines[] =
currentVictim
(currentVictim.Position)
test, _ = (currentVictim.Position)
test ~= currentVictim
currentVictim =
currentVictim =
mePos = root.Position
mePosGround = (mePos, ) mePos
victim, dist = (mePos, distanceToEngage)
currentVictim dist < CONFIG.START_COMBAT
currentVictim ~= victim
currentPlaystyle =
charge =
currentVictim = victim
currentVictim
victim, dist = currentVictim, (currentVictim.Position - mePos).Magnitude
victim dist
DebugLines[] =
idlePosition =
(DebugBrain, mePos, victim.Position)
victimCF = victim.CFrame
victimPos = (victim.Position, ) victim.Position
dist < CONFIG.START_COMBAT
haveSword =
(DebugBrain, victimPos, CONFIG.IMMEDIATE_ATTACK_RADIUS)
(DebugBrain, root.CFrame * .(, , ), root.CFrame * .(, , -CONFIG.START_COMBAT))
hitPos = root.CFrame * .(, , -)
(DebugBrain, hitPos, )
hitDist = ((hitPos - victimPos) * VEC3XZ).Magnitude
currentPlaystyle
i = ()
currentPlaystyle = Playstyles[i]
currentPlaystyleName = PlaystylesNames[i]
currentPlaystyleIndex = i
DebugLines[] = .. currentPlaystyleName
(dt, hum, root, victim, dist, hitDist, mePos, mePosGround, victimPos, victimCF)
hitDist < victim.Position.Y > root.Position.Y -
sword = (char, back, CONFIG.SWORD_NAME)
handle = sword sword:()
handle
(handle, victim, )
(handle, victim, )
targetMove = victimPos
DebugLines[] = .. currentPlaystyleName
DebugLines[] =
idlePosition =
currentPlaystyleIndex >
(currentPlaystyleIndex)
currentPlaystyle =
currentPlaystyleName =
currentPlaystyleIndex =
i,name PlaystylesNames
DebugLines[] ..= .. name .. .. PlaystylesDeaths[i]
Hacking = {
(char, back, root, hum, sword, victim)
DebugLines[] =
sword.Parent = char
handle = sword:()
handle
.()
(victim.Position) == victim
(handle, victim, )
(handle, victim, )
sword.Enabled =
sword:()
.()
.()
sword.Parent = back
}
noPathEvent = (goal)
(currentVictim, (targetMove - goal).Magnitude)
currentVictim (targetMove - goal).Magnitude <
CONFIG.USE_PREDEFS_ON_NOPATH
#Hacking ==
char, back, root, hum = ()
sword = (char, back, CONFIG.SWORD_NAME)
char sword
overrideController =
Hacking[.(#Hacking)](char, back, root, hum, sword, currentVictim)
overrideController =
currentVictim =
a bot to automatically play the game open source
[TITLE UNAVAILABLE]