https://api.tabletopsimulator.com/object/#putobject
"When you call this putObject() to put a card into a deck, the card goes into the end of the deck which is closest to it in Y elevation. So, if both the card and the deck are resting on the table, the card will be put at the bottom of the deck. if the card is hovering above the deck, it will be put at the top."
Code:
-- puts card on bottom of deck
deckPos = deck.getPosition()
card.setPosition({x=deckPos.x,y=deckPos.y-3,z=deckPos.z})
Wait.frames(function() card.putObject(deck) end, 1) -- adding a frame to wait for the above card teleport to happen
Code:
-- puts card on top of deck
deckPos = deck.getPosition()
card.setPosition({x=deckPos.x,y=deckPos.y+3,z=deckPos.z})
Wait.frames(function() card.putObject(deck) end, 1) -- adding a frame to wait for the above card teleport to happen
You could also use deck.getBounds() and calculate a more precise location of the deck's top and bottom and just teleport the card there. TTS engine will then add the card to the deck on it's own.