I have a script and it's supposed to be playing a gif. So I have 48 frames and I've only gotten 25 for now. When I test it, the photo starts blinking. At first I thought it was that it wasn't loading. I checked the output and it says something like this:
21:29:17.565 - Image failed to load: http://www.roblox.com/asset/?id=230054930: Failed to resolve texture format
Can anyone help?
Code
frames = {230020795,230021055,230022130,230023083,230023938,230024173,230024269,230024742,230025991,230026076,230028638,230028781,230028829,230028881,230028915,230054690,230054720,230054806,230054865,230054930,230055354,230055573,230055616,230055672,230055788} function run() for i = 1,#frames do script.Parent.Image = "http://www.roblox.com/asset/?id="..frames[i] wait() end run() end run()
Your question has already been answered in the comments, but here is an example of how I would program this:
frames = { --[[{ assetId, timeToDisplay}]] {230020795, .02}; {230021055, .05} -- and so on } local step = game:GetService("RunService").Heartbeat local st = tick() local curFrame = 1 while true do local t = tick() if t - st >= frames[curFrame][2] then st = t curFrame = curFrame + 1 script.Parent.Image = "rbxassetid://" .. frames[curFrame][1] end step:wait() end
It seems that your question has already been answered, but as a quick note, rather than typing out that URL, you can also just use rbxassetid://<asset id>