new

-- ARGUMENTS
-- points:                 table [vector3,...]
-- height:                 number
-- characterRestrictions:  table (optional) ["abc:123",...]
-- jobRestrictions:        table (optional) {jobName = minRank,...}
-- groupRestrictions:      table (optional) {groupName = minRank,...}

-- RETURNS
-- polyZone: table {
--   polygon:                table
--   height:                 number
--   characterRestrictions:  table
--   jobRestrictions:        table 
--   groupRestrictions:      table
--   onPointInOut:           function          
--   isPointInside:          function
--   refreshPermissions:     function
--   destroy:                function
-- }

local pz = ti.polyZones.new({
  vector3(0,0,0),
  vector3(1,0,0),
  vector3(1,1,0),
  vector3(0,1,0),
},2)

pz:onPointInOut(ti.polyZones.getPlayerPosition,function(isInside)
  print("Is inside: " .. isInside)
end)

if not pz:isPointInside(ti.polyZones.getPlayerPosition()) then
  pz:destroy()
end

Last updated