Tabletop Simulator

Tabletop Simulator

Ver estadísticas:
[SCRIPTING] Check Scripting zone for objects
Hey everyone, i have setup 5 scripting zones for card placement in a line and i have a button that deals cards to each of those zones.

i would like to check each zone for an object/card and if there is one return true and if no card is there then return false.

this is what i tried but it appears to be incorrect.

function CheckEmptySlots1(slot_upgrade_1_guid)
if getObjectFromGuid(slot_upgrade_1_guid) == true then
return true
else
return false
end
end
< >
Mostrando 1-1 de 1 comentarios
Sekkuar666 26 AGO 2016 a las 7:13 
Try something like this.

local zoneGUID = '' --Put the zone GUID here, somehow.

-- getObjects will return a table with all objects on that zone
local zoneObjects = getObjectFromGUID(zoneGUID).getObjects() --mind the case sensitive names

local c = 0
for k,v in pairs(zoneObjects ) do
c = c+1
end

if c == 0 then
-- here the zone was empty
else
-- here the zone had one or more objects in it. You can see how many in the "c" variable
end

That is roughly what you need, shouldn't have problem adapting it to your script.
Última edición por Sekkuar666; 26 AGO 2016 a las 7:14
< >
Mostrando 1-1 de 1 comentarios
Por página: 1530 50

Publicado el: 25 AGO 2016 a las 19:45
Mensajes: 1