I have an issue with the :GetMarkerReachedSignal() function, essentially if i play an animation for the first time it runs the function at the wrong time not at the specific keyframe, specifically at the end of the animation, when i run animation on subsequent attempts it works perfectly. i think this has something to do with the animation loading maybe? however all the animations are preloaded, so idk.
local Fist = {}
local critSound = game:GetService("ReplicatedStorage").Sounds.CombatSound.Undodgeable
local dmg_per_tick = 0.2
local posture_per_tick = 0.2
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerStorage = game:GetService("ServerStorage")
local debris = game:GetService("Debris")
local fistcritanim = game:GetService("ReplicatedFirst").Animations.Weapons.Fist.Crit.Critical
local KanjiVfx = game:GetService("ReplicatedStorage"):WaitForChild("Vfx")["Kanji effect"]
local function WeldEffect(player: Player, effectPart: BasePart?, offsets)
local character = player.Character
local motor6D = Instance.new("Motor6D", effectPart)
motor6D.Part0 = player.Character:WaitForChild("Head")
motor6D.Part1 = effectPart
motor6D.C1 = CFrame.new(offsets.x, offsets.y, offsets.z)
end
local offsets = {
x = 0,
y = 0,
z = 0
}
function Fist.Critical(plr,weapon)
local hum = plr.Character:WaitForChild("Humanoid")
local animtrack = hum:LoadAnimation(fistcritanim)
local Particale = KanjiVfx.Attachment:Clone()
Particale.Parent = plr.Character:WaitForChild("Head")
Particale.ParticleEmitter:Emit(1)
critSound:Play()
task.wait(0.1)
animtrack:GetMarkerReachedSignal("FistCrit"):Once(function()
animtrack:AdjustSpeed(0)
print("Marker Reached")
end)
--local playanimation = ReplicatedStorage.RemoteEvents.Other.PlayAnimation
animtrack:Play()
animtrack:AdjustSpeed(0.6)
debris:AddItem(Particale, 3)
end
return Fist