How i fix Images GUI doesn't load

I wanted to make like a GIF with GUI
with this simple script

wait(1)
local frames = {
    12786141585, 12786181814,12786198717,1278622449,12786236080,12786244162,12787434423,12787437324,12787557475,12787561204,12787564330,12787681457,12787694713,12787697451
}

local decal = script.Parent
local i = 1

while i <= #frames do 
    decal.Image = 'rbxassetid://'..frames[i]
    i = i + 1
    wait(0.12)
    
    if i > #frames then
        local tweenService = game:GetService("TweenService")
        local tweenInfo = TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
        local goal = {ImageTransparency = 1}
        local tween = tweenService:Create(decal, tweenInfo, goal)
        tween:Play()
        wait(1)
		decal:Destroy()
		script["SFX_1"]:play()
    end
end:

But everytime the images doesn’t load in game and it gets blank and so that couses like weird flashlights…

I dont know how else i should fix this.

you should use ContentProvider service to preload assets
here is ur local script with it

wait(1)
local frames = {
    12786141585, 12786181814,12786198717,1278622449,12786236080,12786244162,12787434423,12787437324,12787557475,12787561204,12787564330,12787681457,12787694713,12787697451
}
local AllTable = {}
for i,v in pairs(frames) do
table.insert(AllTable,"rbxassetid://" .. tostring(v))
end
task.spawn(function()
local ContentProvider = game:GetService("ContentProvider")
ContentProvider:PreloadAsync(AllTable)
print("Loaded")
end)
local decal = script.Parent
local i = 1

while i <= #frames do 
    decal.Image = 'rbxassetid://'..frames[i]
    i = i + 1
    wait(0.12)
    
    if i > #frames then
        local tweenService = game:GetService("TweenService")
        local tweenInfo = TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
        local goal = {ImageTransparency = 1}
        local tween = tweenService:Create(decal, tweenInfo, goal)
        tween:Play()
        wait(1)
		decal:Destroy()
		script["SFX_1"]:play()
    end
end

when you run this script again tell me if any error occurs

1 Like

it froze at the first frame of the gif, its not wokring

wait(1)
local frames = {
    12786141585, 12786181814,12786198717,1278622449,12786236080,12786244162,12787434423,12787437324,12787557475,12787561204,12787564330,12787681457,12787694713,12787697451
}
local AllTable = {}
for i,v in pairs(frames) do
table.insert(AllTable,"rbxassetid://" .. tostring(v)
**end** <-- here it gives the error

i edited the script could you try it again now?

Sure, ill let you know if there are any error or if doesn’t work again.

I used another system by using character sheets.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.