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
 

Re: Table within a table for FindPartOnRay (ignore)

Previous Thread :: Next Thread 
opplo is not online. opplo
Joined: 09 Dec 2008
Total Posts: 5320
26 Jun 2014 08:30 AM
So basically I'm trying to make the ray ignore certain objects. I have 2 models that I want the ray to ignore so I've made a table for each model then put that in an overall table for the ray to ignore.
So for example

tab1 = game.Workspace.Model1:getChildren()
tab2 = game.Workspace.Model2:getChildren()

tab_ignore = {tab1,tab2}

raymain = game.Workspace:FindPartOnRay(Ray.new(startpos,vec*length),tab_ignore)

However this returns an error in the output
"Unable to cast Value to Object" for the findpartonray line.

Anybody help please? :)
Report Abuse
Bebee2 is not online. Bebee2
Joined: 17 May 2009
Total Posts: 3985
26 Jun 2014 08:33 AM
local tab = {}
local tab1 = workspace.Model1:children()
local tab2 = workspace.Model2:children()

for _,v in next,tab1 do
if v:IsA'BasePart' then
table.insert(tab,v)
end

for _,v in next, tab2 do
if v:IsA'BasePart' do
table
Insert(tab,v)
end


Then you use tab.
Report Abuse
opplo is not online. opplo
Joined: 09 Dec 2008
Total Posts: 5320
26 Jun 2014 08:34 AM
Thanks, I thought that might be the way to do it.
Report Abuse
opplo is not online. opplo
Joined: 09 Dec 2008
Total Posts: 5320
26 Jun 2014 08:57 AM
Any idea why I'm getting this error for your method?

attempt to call field 'Insert' a nil value

for _,u in next, tab2 do
if u:IsA'BasePart' then
table.Insert(ignorelist,u)
end end
Report Abuse
Bebee2 is not online. Bebee2
Joined: 17 May 2009
Total Posts: 3985
26 Jun 2014 09:00 AM
table.Insert

into

table.insert


Autocorrect loves to do that.
Report Abuse
opplo is not online. opplo
Joined: 09 Dec 2008
Total Posts: 5320
26 Jun 2014 09:10 AM
What a troll.

The ol' unable to cast value to Object has returned.
Report Abuse
Bebee2 is not online. Bebee2
Joined: 17 May 2009
Total Posts: 3985
26 Jun 2014 09:18 AM
Post the code snippet.
Report Abuse
opplo is not online. opplo
Joined: 09 Dec 2008
Total Posts: 5320
26 Jun 2014 09:24 AM
I used FindPartOnRayWithIgnoreList and it works now :)
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