Tabletop Simulator

Tabletop Simulator

View Stats:
Need Scripting Help: using a newly created deck
Hi, I'm quite new to scripting.
Here is my question.

With a numeric for loop and takeObject() I create a completely new deck. Now I want to deal this deck to the players. How can I do this?
I can't figure out how to do this because this new deck will have a GUID which I don't know.

Thanks for helping in advance.
Last edited by TastaturCrasher | Rico; Feb 20, 2020 @ 1:57am
< >
Showing 1-2 of 2 comments
Bone White Feb 21, 2020 @ 8:56am 
the first takeObject() will return a reference to the taken object. then you wait a little (Wait.time()) and then get the rest of your cards, using firstCard.putObject(deck.takeObject(params)) which will return a reference to the deck formed.

For more help, visit #scripting on the official tts discord (link in the main screen)
Bone White Feb 21, 2020 @ 8:59am 
function makeDeck(n) -- n = cards to take deck = getObjectFromGUID("123abc") deck.shuffle() firstCard = deck.takeObject() Wait.time(function() for i=1,n-1 do newDeck = firstCard.putObject(deck.takeObject()) end newDeck.shuffle() newDeck.deal() -- will deal 1 card to all players end, 2 -- waits two seconds ) end
< >
Showing 1-2 of 2 comments
Per page: 1530 50

Date Posted: Feb 19, 2020 @ 3:13pm
Posts: 2