Hello guys, as the title says, I was trying to play multiple animations. Of course I did setup a Content Provider for the animations!
So the problem is, when I run the animations in local scripts, it worked fine. But when I run the animations in server scripts, it got glitched as if I don’t preload the animations. I thought it was because I set up the Content Provider on Client Script at first, turn out that was not the reason why, I tried to set up a same Content Provider on Server Script (both of them are in ReplicatedFirst) and still not working.
It’ll be nice if you guys spend a bit of time answering my question! Thank you!
— The Content Provider Script —
local RS = game:GetService("ReplicatedStorage")
local WPDT = require(RS:WaitForChild("GameDataStorage").Weapons)
local CP = game:GetService("ContentProvider")
local idle = Instance.new("Animation")
local walk = Instance.new("Animation")
idle.AnimationId = "rbxassetid://"..tostring(WPDT:GetWeaponData("IronGloves")["Idle"])
walk.AnimationId = "rbxassetid://"..tostring(WPDT:GetWeaponData("IronGloves")["Walk"])
CP:PreloadAsync({idle})
CP:PreloadAsync({walk})
local attacks = WPDT:GetWeaponAttacks("IronGloves")
local animations = {}
for i,v in pairs(attacks) do
local animation1 = Instance.new("Animation")
local animation2 = Instance.new("Animation")
local animation3 = Instance.new("Animation")
animation1.AnimationId = "rbxassetid://"..tostring(attacks[i].Startup)
animation2.AnimationId = "rbxassetid://"..tostring(attacks[i].Attacking)
animation3.AnimationId = "rbxassetid://"..tostring(attacks[i].Endlag)
table.insert(animations,animation1)
table.insert(animations,animation2)
table.insert(animations,animation3)
end
CP:PreloadAsync(animations)
— The Glitch —
[EDIT] : Notice that the dash animations are loaded fine but not the attacks animations