Video animation script not working

local stuff = {--frames would be here}

local w = 1

local animval = game.ServerStorage.Anim

task.spawn(function()
	while true do
		if animval.Value == true then
			script.Parent.Image = stuff[w]
			if w == #stuff then
				w = 1
			else
				w += 1
			end
		else
			script.Parent.Visible = false
		end
		task.wait(0.01)
	end
end)


So this script plays a ton of frames, to create a video. It doesn’t work. Maybe 3 or 4 frames load, but the others don’t load at all.They are all in the game on parts so I’m pretty confused

1 Like

Try checking output and see if the image cannot be loaded then you test play

Using separately uploaded images is not a good idea. Instead, you should upload multiple images together as a single image.

Here’s something I’ve already made to do just that (instructions included):

1 Like

https://developer.roblox.com/en-us/api-reference/function/ContentProvider/PreloadAsync

This seems like an ad, but thanks lol

1 Like

And for the low price of 0 R$! :+1:

But I linked it both as both a pre-made option, but also to look into how it works (as it’s open source).
Anyway, good luck with your project