I’m making a new gun system and the code won’t load the animations!
Code (Local):
local function LoadAnimations()
for i,v in ipairs(Settings.Anims) do
local a = Instance.new("Animation", script)
if not v == nil or 0 then
a.AnimationId = "rbxassetid://"..v
else
a.AnimationId = "rbxassetid://5345347375" -- random numbers
end
Anims[i] = Humanoid.Animator:LoadAnimation(a)
print(i)
end
for i,v in ipairs(Settings.Anims2) do
local a = Instance.new("Animation", script)
print(i)
if not v == nil or 0 then
local a = Instance.new("Animation", script)
a.AnimationId = "rbxassetid://"..v
Anims[i] = Humanoid.Animator:LoadAnimation(a)
else
Anims[i] = nil
end
end
end
Try deleting the if statements and see if it loads or errors. It might also be that the for loop isn’t running because of some reason (happens to me sometimes). I’m on mobile so I can’t really check.