Hello there, I am looking for a solution on how to gather cards in one zone and move them to another (In this case, a discard pile). The following is what I have so far. My knowledge is self taught and pieced together, so any advice or help is appreciated.
Note that the obj.destruct() is a placeholder for me to test that the script was recognizing cards and decks are in the zone at the same time:
Code:
BlueZoneGUID = "6e422e"
BlueDiscardGUID = "4b9679"
function onLoad()
BlueZone = getObjectFromGUID(BlueZoneGUID)
BlueDiscard = getObjectFromGUID(BlueZoneGUID)
params = {
click_function = "DiscardArea",
function_owner = self,
label = "Discard",
position = {0, 1, 0},
rotation = {0, 180, 0},
width = 800,
height = 400,
font_size = 340,
color = {0.5, 0.5, 0.5},
font_color = {1, 1, 1},
}
self.createButton(params)
end
function DiscardArea(obj, color, alt_click)
zoneObjects = BlueZone.getObjects()
for k, obj in pairs(zoneObjects) do
if obj.tag == 'Card'or obj.tag == 'Deck' then
obj.destruct()
end
end
end
EDIT:
Oooooooooooo boy am I a smarty. I forgot to bracket my coordinates with {} so when I was doing "obj.setPositionSmooth(...)" earlier I was getting an error. Here's the fixed bit for future reference so nobody else has to look dumb like me 
Code:
function DiscardArea(obj, color, alt_click)
zoneObjects = BlueZone.getObjects()
for k, obj in pairs(zoneObjects) do
if obj.tag == 'Card'or obj.tag == 'Deck'then obj.setPositionSmooth({10,10,10},false,true)
end
end
end