I recently made an animation and wanted to make the npc play it. After making the animation I wrote a script and put it in the npc I wrote
script.Parent.ClickDetector.MouseClick:Connect(function(player)
local track = script.Parent.Humanoid:LoadAnimation(script.Parent.AnimSaves.TestAnim)
track:Play()
print("yay")
end)
After writing the script I found out that the animation wouldn't play but would print yay. I tried adding track:Stop but it woludn't fix it. How wolud I fix it? Thank you if you answer

8 comments
Not sure if I remember correctly, but I believe that ClickDetectors with a server script doesn't really work in FE. I would make this a local script and use LocalPlayer instead.
It is a normal script and the animation is for the npc I also tried turning it into local script and it is still not working
@PhantomVisual What? LocalScripts can't even run in the Workspace.
I meant that having the script be a server script while FE is enabled won't trigger the clicked event. However, if you use a local script (and place it where it can run on ghe client) you can use LocalPlayer as the player who clicked it.
No, what you strictly said is "make this script in the ClickDetector local" which renders the script unable to run.
Plus, FE does not affect a ClickDetector unless the script associated with it is doing something that should be done on the client. Scripts in ClickDetectors should be server scripts. The type of script that is used with a ClickDetector is entirely irrelevant.
^ Ignore what I said about ClickDetectors not returning the player who clicked it while FE is enabled, @RobloxWhizYT was correct.
ok thats good but I have already got the answer