|
| 01 Sep 2012 07:36 PM |
local x1 = 5 local y1 = 5 local z1 = 50 local start_point = (game.Workspace.Player325.Head.CFrame*CFrame.new(-x1,-y1,0)).p local end_point = (game.Workspace.Player325.Head.CFrame*CFrame.new(x1,y1,-z1)).p
r3 = Region3.new( Vector3.new( math.min(start_point.X, end_point.X), math.min(start_point.Y, end_point.Y), math.min(start_point.Z, end_point.Z) ), Vector3.new( math.max(start_point.X, end_point.X), math.max(start_point.Y, end_point.Y), math.max(start_point.Z, end_point.Z) ) )
p = Instance.new("Part") p.Size = Vector3.new(x1*2,y1*2,z1) p.CFrame = game.Workspace.Player325.Head.CFrame*CFrame.new(0,0,-z1/2) p.Name = "SimulatedRegion3" p.TopSurface = "Smooth" p.BottomSurface = "Smooth" p.CanCollide = false p.Anchored = true p.Transparency = 0.5 p.Parent = game.Workspace.Player325 game.Debris:AddItem(p,3)
table = game.Workspace:FindPartsInRegion3(r3, game.Workspace.Player325, 20)
print("Found "..#table.." Parts") print("------------------------")
for i=1,#table do print(table[i].Name) wait(0.1) end
print("------------------------")
This script checks for parts in a 6x6x50 region in front of my character's face. However, I can't use this because Region3 cannot be rotated...
Anything better I could use that CAN be rotated? |
|
|
| Report Abuse |
|
|
UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
|
| 01 Sep 2012 07:38 PM |
http://wiki.roblox.com/index.php/Region3
Property Type Description Region3.CFrame CFrame The center location and rotation of the the Region3 |
|
|
| Report Abuse |
|
|
|
| 01 Sep 2012 07:39 PM |
| It's a bit more advanced than basic scripting... :L |
|
|
| Report Abuse |
|
|
|
| 01 Sep 2012 07:40 PM |
@UFAIL2 "All the of a properties Region3 userdata are read-only and cannot be set or edited directly. You must create a new Region3 using Region3.new() to make the properties change."
You CANNOT rotate or move Region3. |
|
|
| Report Abuse |
|
|
| |
|
|
| 01 Sep 2012 07:41 PM |
| @XxChop I don't see why that matters. |
|
|
| Report Abuse |
|
|
| |
|
|
| 01 Sep 2012 07:43 PM |
| Why not help with this problem? :| |
|
|
| Report Abuse |
|
|
| |
|
|
| 01 Sep 2012 10:14 PM |
| For Scripting Helpers, you guys aren't very helpful :c |
|
|
| Report Abuse |
|
|
| |
|
|
| 01 Sep 2012 10:24 PM |
| .... I thought you guys were good scripters. |
|
|
| Report Abuse |
|
|