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)

1 comment

0

Just add an if keyframeName == “release” then