I am making a slideshow that when you click an arrow, it will change.
I have a script that does that, but I want it to be animated. If anyone could tweak this script and tell me how to animate it that would be very appreciated!
local mainFrame = script.Parent.Parent
local slidesFolder = mainFrame.Slides
local backArrow = mainFrame.BackArrow
local forwardArrow = mainFrame.ForwardArrow
local currentSlide = 1
local collectedSlides = slidesFolder:GetChildren()
forwardArrow.MouseButton1Click:Connect(function()
if currentSlide == 10 then
print("Maximum slide alread reached!")
return
end
currentSlide = currentSlide + 1
for _, slide in pairs(collectedSlides) do
if slide.Name == "Slide" .. currentSlide then
slide.ImageTransparency = 0
else
slide.ImageTransparency = 1
end
end
end)
backArrow.MouseButton1Click:Connect(function()
if currentSlide == 1 then
print("Lowest slide alread reached!")
return
end
currentSlide = currentSlide - 1
for _, slide in pairs(collectedSlides) do
if slide.Name == "Slide" .. currentSlide then
slide.ImageTransparency = 0
else
slide.ImageTransparency = 1
end
end
end)