Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How would I play an animation?

I made several animations for my project, but when I attempt to run them they do not play, how could I fix this? Here is my code in a Local Script, and animation I am running has the Id in it for my animation.

local animation=game.Workspace.Anim1
np=game.Players.LocalPlayer
np.Chatted:connect(function(msg)
	if msg==string.lower("atk") then
		local atk=np.Character.Humanoid:LoadAnimation(animation)
		atk:Play()
	end
end)

1 answer

Well, after reviewing this script several times, I only found an error in line 4.

local animation=game.Workspace.Anim1
np=game.Players.LocalPlayer
np.Chatted:connect(function(msg)
    if msg:lower() == "atk" then
        local atk = np.Character.Humanoid:LoadAnimation(animation)
        atk:Play()
    end
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.