Basically im making a skill where, in the finisher, it finishes off the enemy by slamming them into the ground from a high place. The only problem is, im tryna make it so it spawns rocks by using a rock module but when it hits the ground, rocks dont spawn at all or it spawns but only right when the HumanoidRootPart touches the ground but for it to do the, the character gotta be either laying down or PlatformStand = False. Is there a better way I can do this?
KickAnim.KeyframeReached:Connect(function(kf)
if kf == "Kick" then
Knockbackenemy:Destroy()
local Knockback2 = Instance.new("AlignPosition",ERoot)
Knockback2.MaxForce = math.huge
Knockback2.ForceLimitMode = Enum.ForceLimitMode.Magnitude
Knockback2.Mode = Enum.PositionAlignmentMode.OneAttachment
Knockback2.MaxVelocity = 1000
Knockback2.Responsiveness = 100
Knockback2.Attachment0 = ERoot.RootAttachment
Knockback2.Position = ERoot.Position + Root.CFrame.LookVector * 20 + Vector3.new(0,30,0)
task.wait(1)
coroutine.resume(coroutine.create(function()
Root.Position = ERoot.Position + Vector3.new(0,4,0)
Root.Anchored = true
Root.CFrame = CFrame.lookAt(Root.Position, ERoot.Position)
end))
local Downslam = Humanoid:LoadAnimation(script.Downslam)
Downslam:Play()
task.wait(0.2)
Knockback2:Destroy()
EHum:TakeDamage(100)
ERoot.CFrame = CFrame.lookAt(ERoot.Position, Root.Position)
local Ground = workspace:WaitForChild("Baseplate")
local direction = (ERoot.Position - Ground.Position).Unit
local Down = Instance.new("BodyVelocity",ERoot)
Down.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
Down.P = 1000
Down.Velocity = Vector3.new(0,-200,0)
local rocks
rocks = Ground.Touched:Connect(function(hit)
if hit.Parent == Enemy then
Replicator:FireAllClients("CR", "Rocks", {
["eRoot"] = ERoot
})
Down:Destroy()
end
end)
end
end)