Run it
Copy the script and paste it into your executor.
RunService = :()
Workspace = :()
Players = :()
Debris = :()
TweenService = :()
player = Players.LocalPlayer
character = player.Character player.CharacterAdded:()
rootPart = character:()
humanoid = character:()
CONFIG = {
ScanRadius = ,
ProjectileSpeedMin = ,
DodgeDist = ,
WallBuffer = ,
BaseCooldown = ,
OverdriveCooldown = ,
StressThreshold = ,
StressDecay = ,
}
stressLevel =
lastDodgeTime =
isDodging =
envParams = RaycastParams.()
envParams.FilterType = .RaycastFilterType.Exclude
threatParams = RaycastParams.()
threatParams.FilterType = .RaycastFilterType.Exclude
()
ignoreList = {character, Workspace.CurrentCamera}
envParams.FilterDescendantsInstances = ignoreList
threatParams.FilterDescendantsInstances = {Workspace.CurrentCamera}
character.DescendantAdded:(updateFilters)
()
(mode, pos)
isPanic = mode ==
color = isPanic .(, , ) .(, , )
sound = .(, rootPart)
sound.SoundId =
sound.PlaybackSpeed = isPanic
sound.Volume =
sound:()
Debris:(sound, )
.(()
_, v (character:())
v:() v.Transparency <
g = v:()
g.Parent = Workspace
g.Anchored =
g.CanCollide =
g.CFrame = v.CFrame
g.Material = .Material.ForceField
g.Color = color
g.Transparency =
_, c (g:()) c:()
Debris:(g, )
tween = TweenService:(g, TweenInfo.(), {Transparency = })
tween:()
)()
(origin, direction, distance)
ray = Workspace:(origin, direction * distance, envParams)
targetPos
ray
hitNormal = ray.Normal
slideDir = direction - (direction:(hitNormal) * hitNormal)
slideDir.Magnitude <
targetPos = origin + (direction * (ray.Distance - CONFIG.WallBuffer))
targetPos = origin + (slideDir.Unit * (distance * ))
targetPos = origin + (direction * distance)
floorRay = Workspace:(targetPos + .(, , ), .(, -, ), envParams)
floorRay
origin
targetPos
()
scanParams = OverlapParams.()
scanParams.FilterDescendantsInstances = {character}
scanParams.FilterType = .RaycastFilterType.Exclude
parts = Workspace:(rootPart.Position, CONFIG.ScanRadius, scanParams)
chosenThreat =
threatType =
threatVector = .(,,)
_, part (parts)
part.Anchored part.AssemblyLinearVelocity.Magnitude > CONFIG.ProjectileSpeedMin
vel = part.AssemblyLinearVelocity
toMe = (rootPart.Position - part.Position)
vel.Unit:(toMe.Unit) >
predictRay = Workspace:(part.Position, vel * , threatParams)
predictRay predictRay.Instance:(character)
chosenThreat = part
threatType =
threatVector = vel.Unit
model = part.Parent
model model:() model ~= character
enemyRoot = model:()
enemyRoot
eHum = model.Humanoid
eHum.Health >
toPlayer = (rootPart.Position - enemyRoot.Position)
dist = toPlayer.Magnitude
facing = enemyRoot.CFrame.LookVector:(-toPlayer.Unit)
speed = enemyRoot.AssemblyLinearVelocity.Magnitude
dist < (facing > speed > )
chosenThreat = enemyRoot
threatType =
threatVector = (rootPart.Position - enemyRoot.Position).Unit
chosenThreat, threatType, threatVector
RunService.Heartbeat:((dt)
now = ()
stressLevel > stressLevel = .(, stressLevel - (CONFIG.StressDecay * dt))
currentCooldown = (stressLevel > CONFIG.StressThreshold) CONFIG.OverdriveCooldown CONFIG.BaseCooldown
isDodging (now - lastDodgeTime < currentCooldown)
threat, , dirVec = ()
threat
isDodging =
mode = (stressLevel > CONFIG.StressThreshold)
dodgeDir = .(,,)
==
left = dirVec:(.(, , ))
dodgeDir = (.() > ) left -left
stressLevel = stressLevel +
==
mode ==
dodgeDir = -dirVec + (.(.()-, , .()-))
left = dirVec:(.(, , ))
dodgeDir = dirVec + (left * )
stressLevel = stressLevel +
dodgeDir = .(dodgeDir.X, , dodgeDir.Z).Unit
finalPos = (rootPart.Position, dodgeDir, CONFIG.DodgeDist)
(finalPos - rootPart.Position).Magnitude >
rootPart.AssemblyLinearVelocity = .zero
rootPart.AssemblyAngularVelocity = .zero
lookTarget = ( == ) (rootPart.Position + dodgeDir) (threat.Position)
rootPart.CFrame = .(finalPos, .(lookTarget.X, finalPos.Y, lookTarget.Z))
lastDodgeTime = now
(mode, finalPos)
.()
isDodging =
)
An autonomous Dodge script dodges most attacks

Universal