function AnimationPlayer.PlayAnimation(H,B)local t=Tool.Parent if t then local H=t:FindFirstChildOfClass("\072\117\109\097\110\111\105\100")if H then local t=Animationids[B]if t then local E=t[H.RigType]if E then local t=H:LoadAnimation(GetAnimation(E))local g=AnimationSettings[B]or{}t:Play(g.FadeTime,g.Weight,g.Speed)return t end else warn("\077\105\115\115\105\110\103 \097\110\105\109\097\116\105\111\110 \110\097\109\101\058 "..tostring(B))end end end end return AnimationPlayer

function AnimationPlayer:PlayAnimation(AnimationName)
	local Character = Tool.Parent
	if Character then
		local Humanoid = Character:FindFirstChildOfClass("Humanoid")
		if Humanoid then
			local AnimationGroup = Animationids[AnimationName]
			if AnimationGroup then
				local Animationid = AnimationGroup[Humanoid.RigType]
				if Animationid then
					local LoadedAnimation = Humanoid:LoadAnimation(GetAnimation(Animationid))
					local AnimationData = AnimationSettings[AnimationName] or {}
					LoadedAnimation:Play(AnimationData.FadeTime,AnimationData.Weight,AnimationData.Speed)
					
					return LoadedAnimation
				end
			else
				warn("Missing animation name: "..tostring(AnimationName))
			end
		end
	end
end

return AnimationPlayer
