I know you cant import .GIF Files into Roblox Studio cuz you know that would be all too easy, so my alternative is just importing frame by frame and making a GIF the hard way. Currently i am only testing with 42 picture frames from the original GIF.
Idea is press a button which are linked to 6 different parts that contain an image. If i could i would want to send them to the ReplicatedStorage and then back into the Workspace, but this method is way too advance for me at the moment. So ive been trying to make the Decal transparent and back to a solid in the matter of 0.03 seconds. Which seems to work fine but if you click the button again it obviously speeds the process up. I thought about adding a debounce but im not sure how to script that exactly for it to work properly.
All and all im just trying to make the decal disappear and have another reappear in a matter of half a second.
For the sake of this forum and repeated coding i have cut the 42 frames into 6 frames. Heres my current code:
local script = script.Parent.Parent
local image1 = script.Parent.image1
local image2 = script.Parent.image2
local image3 = script.Parent.image3
local image4 = script.Parent.image4
local image5 = script.Parent.image5
local image6 = script.Parent.image6
n = 6
function GIFOn()
while true do
n = 6
if image1.Decal.Transparency == 1
then
image1.Decal.Transparency = 0
else
image1.Decal.Transparency = 1
end
wait(0.03)
if image2.Decal.Transparency == 1
then
image2.Decal.Transparency = 0
else
image2.Decal.Transparency = 1
end
wait(0.03)
if image3.Decal.Transparency == 1
then
image3.Decal.Transparency = 0
else
image3.Decal.Transparency = 1
end
wait(0.03)
if image4.Decal.Transparency == 1
then
image4.Decal.Transparency = 0
else
image4.Decal.Transparency = 1
end
wait(0.03)
if image5.Decal.Transparency == 1
then
image5.Decal.Transparency = 0
else
image5.Decal.Transparency = 1
end
wait(0.03)
if image6.Decal.Transparency == 1
then
image6.Decal.Transparency = 0
else
image6.Decal.Transparency = 1
end
wait(0.03)
end
end
script.ClickDetector.MouseClick:connect(GIFOn)

4 comments
You should just use a for loop instead of this many ifs. Also, you should use a SPRITE instead of 42 images.
wait how could i use a SPRITE? That sounds ways easier and simple then what im doing
You can't use those... I wish.
You can use them. Just make sure everythign is aligned on a grid, then you just loop through it like for i=1,NUMBER_OF_PICTURES_IN_SPRITE do pic.Postition = UDim2.new(NUMBER_OF_PICTURES_IN_SPRITE/i,0,0,0) end