Some of your image ids are incorrect. I first copy the id and put it into an image label, Studio will then format and get the correct image id for you. It saves a lot of time for me.
You can then remove the pcalls in the code. Loading a bad image will not stop the code from running.
You can also simplify your code a lot by only using one counter and swapping variables around making the visible image label fade out the next loop.
I would aslo recommend that you use the tween service as you can create a tween of both image labels and run them at the same time giving you the fade in/out effect you want.
Example(As EXpodo1234ALT said you should be using alocal script for client side gui things):-
02 | "2721116470" , "2673015010" , "1417408615" , "1417402635" |
05 | local tweenServ = game:GetService( "TweenService" ) |
07 | local imageLabel 1 = script.Parent.ImageLabel 1 |
08 | local imageLabel 2 = script.Parent.ImageLabel 2 |
11 | local fadeOut = { ImageTransparency = 1 } |
12 | local fadeIn = { ImageTransparency = 0 } |
13 | local tweenInfo = TweenInfo.new( 4 ) |
17 | local function nextIndex() |
19 | if nextId > #idList then |
24 | local function mkTween(imageLabel, tbl) |
25 | return tweenServ:Create(imageLabel, tweenInfo, tbl) |
33 | local tween 1 , tween 2 = mkTween(imageLabel 1 , fadeOut), mkTween(imageLabel 2 , fadeIn) |
37 | tween 2. Completed:Wait() |
42 | local tmp = imageLabel 1 |
43 | imageLabel 1 = imageLabel 2 |
I have also uploaded the model here.
Hope this help, comment if you would like me to explain more about the tween service.