This is a humanoid, scale 1, that uses :ApplyDescriptionReset() to switch between avatars for each attack it uses. For some reason, after running the below function, it will erratically fling itself around, especially if a player approaches it. This effect seems to stack if the attack is repeated, but stops once :ApplyDescriptionReset() is run.
local wn = Instance.new("Part")
wn.Size = Vector3.new(.25,.25,100)
wn.Material = Enum.Material.Neon
wn.Color = Color3.fromRGB(255,0,0)
wn.Transparency = 0
wn.CanCollide = false
wn.Anchored = true
local a0 = Instance.new("Attachment")
a0.Position = Vector3.new(-2,0,0)
local a1 = Instance.new("Attachment")
a1.Position = Vector3.new(2,0,0)
function Attack(target)
local char = script.Parent.Parent
local origin = char:GetPivot()
local sword = game.Lighting.Assets.MimicSword:Clone()
sword.Parent = char
char.PrimaryPart.Anchored = true
char.SlashHighlight.Enabled = true
local b0, b1
local function makeNewAttachments()
b0, b1 = a0:Clone(), a1:Clone()
b0.Parent, b1.Parent = char.UpperTorso, char.UpperTorso
char.SlashTrail.Attachment0 = b0
char.SlashTrail.Attachment1 = b1
end
for i=1,6 do
local o = math.random()*math.pi*2
local w = wn:Clone()
local pos = target:GetPivot().Position
local root = CFrame.new(Vector3.new(pos.X,origin.Position.Y,pos.Z))*CFrame.Angles(0,o,0)
w.Parent = char.Parent
w:PivotTo(root)
game.Debris:AddItem(w,.75)
if not (b0 and b0.Parent) or not (b1 and b1.Parent) then
makeNewAttachments()
end
char.SlashTrail.Enabled = true
b0.Parent, b1.Parent = char.UpperTorso, char.UpperTorso
char:PivotTo(root*CFrame.new(0,0,50))
local a = char.Humanoid.Animator:LoadAnimation(char.SlashStart)
local b = char.Humanoid.Animator:LoadAnimation(char.Slash)
a:Play()
for i=1,18 do
task.wait(.03)
pos = target:GetPivot().Position
char:PivotTo(CFrame.new(char:GetPivot().Position,Vector3.new(pos.X,origin.Position.Y,pos.Z)))
w.Size = Vector3.new(w.Size.X,w.Size.Y,(char:GetPivot().Position-target:GetPivot().Position).Magnitude*2)
w:PivotTo(CFrame.new(Vector3.new(pos.X,origin.Position.Y,pos.Z))*CFrame.Angles(0,math.rad(char.PrimaryPart.Orientation.Y),0))
end
task.wait(.25)
a:Stop()
b:Play()
local rp = RaycastParams.new()
rp.FilterType = Enum.RaycastFilterType.Exclude
rp.FilterDescendantsInstances = {char.Parent}
local slash = workspace:Spherecast(char.HumanoidRootPart.Position,5,CFrame.Angles(0,o,0).LookVector*100,rp)
if slash and slash.Instance then
local plr = game.Players:GetPlayerFromCharacter(slash.Instance.Parent)
local hum = slash.Instance.Parent:FindFirstChildOfClass("Humanoid")
if plr and hum then
hum:TakeDamage(1250)
end
end
task.wait(.2)
char.SlashTrail.Enabled = false
task.wait(.2)
b:Stop()
end
char:PivotTo(origin)
char.PrimaryPart.Anchored = false
char.PrimaryPart.AssemblyLinearVelocity = Vector3.new()
char.PrimaryPart.AssemblyAngularVelocity = Vector3.new()
--char.Humanoid:ChangeState(Enum.HumanoidStateType.Landed)
char.SlashHighlight.Enabled = false
--char.SlashTrail.Enabled = false
sword:Destroy()
end
return Attack
Clip below of what’s happening, the part where I walk towards it is sped up just to keep the clip length short
No BodyMovers or mover constraints are used on the NPC