im getting the error ( Invalid animation id '<error: null id>': - Servidor - Combat_Handler:19)

the code:

local Animations = script.Animations

local KeyProvider = game:GetService("KeyframeSequenceProvider")

local Combat_Handler ={ MeleeAnims = { ["L"] = Animations.Melee1, ["LL"] = Animations.Melee2, ["LLL"] = Animations.Melee3, ["LLLL"] = Animations.Melee4, },

}

function Combat_Handler.getAnimation(Humanoid,sequence) local length = 0

local Keysequence = KeyProvider:GetKeyframeSequenceAsync(Combat_Handler.MeleeAnims[sequence].AnimationId)
local Keyframes = Keysequence:GetKeyFrames()

for i=1,#Keyframes do
	local time = Keyframes[i].time
	if time > length then
		length = time		
	end

end

return Humanoid.Animator:LoadAnimation(Combat_Handler.MeleeAnims[sequence]), length	

end

return Combat_Handler

the video that i copied the script : https://www.youtube.com/watch?v=UVT-eFsSxGQ

1 comment

0

can u please fix the codeblocks to make it a bit more easier to read? Also, is the animation made by you? If not, that might be why. I believe u can only use animations made by you.