New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

How do I get a specific keyframe from my chambering animation?

Asked by 5 days ago

I got a code that detects keyframe names, but I can't get it so that it's only specific for a certain name. I made one keyframed name pull and one keyframed named release but I can't separate them. This is my code:

local player = game.Players:GetChildren()[1]
local character = game.Workspace:WaitForChild(player.Name)
local humanoid = character:WaitForChild("Humanoid")

local anim = script.Parent.chamber
local animTrack = humanoid:LoadAnimation(anim)

animTrack.KeyframeReached:Connect(function(keyframeName)
    print("Keyframe reached:"..keyframeName)
    script.Parent.pull:FireServer()
    end)

script.Parent.Equipped:Connect(function()
animTrack:Play()
end)
script.Parent.Unequipped:Connect(function()
animTrack:Stop()
end)
0
Just add an if keyframeName == “release” then MmadProgrammer 20 — 4d

Answer this question