I'm trying to make an animation not run a second time until it is finished running the first time. The problem is, however, that the animation only runs once because the KeyframeReached event does not fire. This is a local script in starter gui and nothing appears in the output -- at all.
local plr = game.Players.LocalPlayer
repeat wait() until plr.Character
local hum = plr.Character:WaitForChild("Humanoid")
local mouse = plr:GetMouse()
local anim = workspace:WaitForChild("Animation")
local canPlay = true
mouse.KeyDown:connect(function(key)
if key:lower() == "q" and canPlay then
canPlay = false
local animTrack = hum:LoadAnimation(anim)
animTrack.KeyframeReached:connect(function(name)
print("fired")--Does not print
print(name)--Does not print
if name == "End" then
canPlay = true
end
end)
animTrack:Play()
end
end)

2 comments
There are multiple keyframes, although only the last one has a name. There are no scripts messing this script up. This script is the only script in the game. The only other objects are the BasePlate and Animation in workspace.
Are you testing this in Studio? My best guess as of now is that Offline Mode is showing results different than Online Mode.