generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

I need something more efficient than Region3

Previous Thread :: Next Thread 
SuperODgirl9000 is not online. SuperODgirl9000
Joined: 29 Aug 2012
Total Posts: 264
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 is not online. 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
SuperODgirl9000 is not online. SuperODgirl9000
Joined: 29 Aug 2012
Total Posts: 264
01 Sep 2012 07:39 PM
It's a bit more advanced than basic scripting... :L
Report Abuse
SuperODgirl9000 is not online. SuperODgirl9000
Joined: 29 Aug 2012
Total Posts: 264
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
XxChopSlaperxX is not online. XxChopSlaperxX
Joined: 09 Nov 2010
Total Posts: 3112
01 Sep 2012 07:41 PM
Who's your main?
Report Abuse
SuperODgirl9000 is not online. SuperODgirl9000
Joined: 29 Aug 2012
Total Posts: 264
01 Sep 2012 07:41 PM
@XxChop I don't see why that matters.
Report Abuse
XxChopSlaperxX is not online. XxChopSlaperxX
Joined: 09 Nov 2010
Total Posts: 3112
01 Sep 2012 07:42 PM
Why not say it?
Report Abuse
SuperODgirl9000 is not online. SuperODgirl9000
Joined: 29 Aug 2012
Total Posts: 264
01 Sep 2012 07:43 PM
Why not help with this problem? :|
Report Abuse
SuperODgirl9000 is not online. SuperODgirl9000
Joined: 29 Aug 2012
Total Posts: 264
01 Sep 2012 10:06 PM
Bump?
Report Abuse
SuperODgirl9000 is not online. SuperODgirl9000
Joined: 29 Aug 2012
Total Posts: 264
01 Sep 2012 10:14 PM
For Scripting Helpers, you guys aren't very helpful :c
Report Abuse
SuperODgirl9000 is not online. SuperODgirl9000
Joined: 29 Aug 2012
Total Posts: 264
01 Sep 2012 10:17 PM
Guiiiiiiseeee
Report Abuse
SuperODgirl9000 is not online. SuperODgirl9000
Joined: 29 Aug 2012
Total Posts: 264
01 Sep 2012 10:24 PM
.... I thought you guys were good scripters.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image