Isosta
|
  |
| Joined: 10 May 2015 |
| Total Posts: 14729 |
|
|
| 24 May 2016 12:19 PM |
functions.isPlaceable = function(turret) local TrrtSiz = turret:GetModelSize() local position = turret.PrimaryPart.Position local r3 = Region3.new(position-TrrtSiz/2,position+TrrtSiz/2) local parts = game.Workspace:FindPartsInRegion3(r3,nil) local canbuild = true for chck = 1, #parts do if string.sub(parts[chck].Parent.Parent.Name:lower(),1,6) ~= "turret" then print(parts[chck].Name,parts[chck].Parent.Name,parts[chck].Parent.Parent.Name) canbuild = false end if canbuild then canbuild = false local MapR3 = Region3.new(position-(functions.returnMap():GetModelSize()/2),position+(functions.returnMap():GetModelSize()/2)) print(MapR3.Size) for i,v in ipairs(game.Workspace:FindPartsInRegion3WithIgnoreList(MapR3,{functions.returnMap().Turrets,functions.returnMap().CameraPart},20000)) do print(v.Name) if string.sub(v.Parent.Parent.Name:lower(),1,6) == 'turret' then canbuild = true end end return canbuild end end end |
|
|
| Report Abuse |
|
Isosta
|
  |
| Joined: 10 May 2015 |
| Total Posts: 14729 |
|
|
| 24 May 2016 12:22 PM |
proof they're not together
http://prntscr.com/b7xk8s |
|
|
| Report Abuse |
|
|
| 24 May 2016 12:25 PM |
Add this
else return false
nothing happens if canbuild is false. |
|
|
| Report Abuse |
|
Isosta
|
  |
| Joined: 10 May 2015 |
| Total Posts: 14729 |
|
|
| 24 May 2016 12:29 PM |
| returns true regardless. It's printing that the parts inside the turret are within the region3. |
|
|
| Report Abuse |
|
Isosta
|
  |
| Joined: 10 May 2015 |
| Total Posts: 14729 |
|
|
| 24 May 2016 12:33 PM |
updated the script to print out everything that gets run through the last for loop
"Found inside the Map Region3: BPart Descendant of turretTop"
So it's detecting parts of the model to be inside the model. |
|
|
| Report Abuse |
|