Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- scripts to flip the top card of a deck when it is removed from a bag
- -- global version
- -- code to be placed in global
- function onObjectLeaveContainer(bag, obj)
- log(obj.tag)
- if obj.tag == "Deck" then
- -- make test whatever you need to check for the desired deck
- if obj.getName() == "Flip Deck" then
- Wait.condition(function() flipTop(obj) end, function() return obj.resting end)
- end
- end
- end
- function flipTop(deck)
- local pos = deck.getPosition()
- deck.takeObject({ position = { pos.x, pos.y + 2, pos.z}, flip = true })
- end
Add Comment
Please, Sign In to add comment