So yeah, my goal is to upload an gif to play in an imagelabel. Like an video.
Of course, my poor scripting skills came to play and i tried to “switch” it over from an Decal / texture to an imagelabel (i failed of course)
If you need more explanation feel free to ask
Here is the code:
local rows = 23
local columns = 5
local Frames = rows*columns
local currentFrame = 1
local currentRow,CurrentColumn = 0,0
local linear = false
local fps = 30
local full60fps = false
local size = script.Parent.Size
local function api()
local x = columns*size.Y.Scale
local y = rows*size.X.Scale
script.Parent.ImageRectOffset.X = x
script.Parent.ImageRectOffset.Y = y
end
api()
while true do
if not full60fps then wait(1/fps) else game:GetService("RunService").Stepped:Wait() end
if linear then
script.Parent.ImageRectOffset.Y = script.Parent.ImageRectOffset.Y + size.X
if script.Parent.ImageRectOffset.Y > size then
script.Parent.ImageRectOffset.Y = 0
end
else
CurrentColumn = CurrentColumn + 1
if CurrentColumn > columns then
CurrentColumn = 1
currentRow = currentRow + 1
end
if currentFrame > Frames then
currentRow,CurrentColumn,currentFrame = 1,1,1
end
script.Parent.ImageRectOffset.X = size.X*(CurrentColumn-1)
script.Parent.ImageRectOffset.Y = size.Y*(currentRow-1)
currentFrame = currentFrame+1
end
end
Please note that i don’t force you neither do i request from you to fix this script, i only want to know how i can make it be functional
Scripts used in this post are NOT by me, original post: Gifs in Roblox with only 1 image!