Invalid animation id '<error: assetid does not start with a number>':

I don’t know if this error happens because of the script alone, but the error appears in the Output, so it must be a Scripting Error.

local function LoadAnimations()
	--...
	AnimationFolder.Client.Equip.AnimationId = "rbxassetid://" .. tostring(GunConfig.Animations.Client.Equip) -- Error appears here
	--...
	local EquipAnimation = VM.Humanoid:LoadAnimation(AnimationFolder.Client.Equip)
	EquipAnimation.Priority = Enum.AnimationPriority.Action2
		
	EquipAnimation:Play()
	EquipAnimation.Stopped:Connect(function()
		equipped = true
	end)
         --...
end

If you guys need more info just ask

2 Likes

You’re turning the asset id into a string, it has to be a number, otherwise it doesn’t work. Maybe tonumber() can work.

1 Like

once the GunConfig.Animations.Client.Equip is a number all you have to do is reference it

	AnimationFolder.Client.Equip.AnimationId = "rbxassetid://" ..GunConfig.Animations.Client.Equip

1 Like

Why are you converting it into a string?

I think its all the problem because 120 is different than "120".

Try using tonumber().

1 Like

It looks like you’re referencing a value object so make sure to say:

AnimationFolder.Client.Equip.AnimationId = "rbxassetid://" .. tostring(GunConfig.Animations.Client.Equip.Value)

The .Value is important.

1 Like