There's a lot of material in this thread that might be helpful.
There are a number of possible approaches for what you're describing. I'll assume that when you say "play a GIF" you intend to use a gif or colorgif contraption?
If you have set up a button to take you to another card, its script might look something like the following:
on click do go["otherCard"] end
If you simply wanted to wait for time to elapse before changing cards, you could use the sleep[] function, which accepts a number of frames to wait as an argument. Decker runs at 60 frames per second, so a 5 second delay would look like this:
on click do sleep[5 * 60] go["otherCard"] end
While Decker is sleeping, the user can't interact with other widgets, and contraptions that normally animate or otherwise update themselves on every frame will appear to be "frozen". Some contraptions are designed to allow an external script to explicitly tell them to update themselves; by convention this will often take the form of exposing an .animate[] function which can be called from the outside. I have updated the gif and colorgif contraptions (see above) to support this convention. (If you already have a gif or colorgif contraption in your deck, re-pasting the updated definition from the bazaar will "upgrade" any existing instances of the contraption.)
If the card contained a gif widget named "mygif", we could rewrite the above script to give it a chance to keep running while Decker waits for 5 seconds by using a loop and only sleeping one frame at a time:
on click do each in range 5 * 60 mygif.animate[] sleep[1] end go["otherCard"] end
You alluded to wanting the GIF to start playing only when the button was clicked in the first place. Perhaps you meant you want the contraption to appear during that interval? This sort of thing can be done by manipulating the .show attribute of the widget. Supposing the contraption was initially set to "Show None",
on click do mygif.show:"solid" each in range 5 * 60 mygif.animate[] sleep[1] end mygif.show:"none" go["otherCard"] end
(Note that I reset the GIF to be invisible again at the end; this is not essential, but makes testing easier!)
I'd also like to point out that it's very straightforward to script simple "slideshow" animations with sleep[] by putting each frame on its own card:
on click do go["firstCard"] sleep[30] go["secondCard"] sleep[30] go["thirdCard"] sleep[30] # and so on end
Or more concisely, for many frames of the same delay,
on click do each cardName in ("firstCard","secondCard","thirdCard","fourthCard","fifthCard") go[cardName] sleep[30] end end
Of course, having a very large number of frames in such an animation can also make your deck quite large!
Does any of this point you in the right direction?