I have a mass amount of NPCs in a Folder (named “ClapAvis”), all with Animations in them (named “ClapAnim”) and want to have a script where all ClapAnims are played for each NPC in unison. In less jargonistic terms, I wanna make all my NPCs clap at the same time.
I have attempted to get it to find the Animations by name, that were each inside Groups within the Folder (hence use of GetDescendants):
local claps = game.Workspace.ClapAvis:GetDescendants()
for i = 1, 3 do
if claps.Name == "ClapAnim" then
print("hooray it worky")
end
print("if only this, no worky")
end
The only output received is if only this, no worky
3 times (no confusion in this quantity). Suffice to say, no worky. It also fails when the ClapAnim is in the root of the Folder.
I want to be able to get it to be able to locate these animations, and then play all of these at the same time without having a separate line for each individual one. It’ll be triggered by a ClickDetector, but that’s further down the track. I need the function itself to work upon running before putting it to a trigger.