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: Weird error

Previous Thread :: Next Thread 
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
16 Sep 2013 08:16 PM
local touching = false
local part = nil
local capPre = nil --capturing precent
local pos1 = Vector3.new(368.5, -26.4, -1334.5)
local pos2 = Vector3.new(417.5, -44.4, -1391.5)


while wait(1) do
local region = Region3.new(pos1, pos2)
local parts = game.Workspace:FindPartsInRegion3(region, 200)
for i = 1, #parts do

print(parts[i].Name)
end
end


got this in output
21:16:07.848 - Unable to cast value to Object
Report Abuse
rosenburger is not online. rosenburger
Joined: 03 Aug 2009
Total Posts: 8407
16 Sep 2013 08:18 PM
That's not a weird error if you know what classes and objects are.
I'm not familiar with :FindPartsInRegion(), sorry.

~Professional ROBLOX Human
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
16 Sep 2013 08:18 PM
"I'm not familiar with :FindPartsInRegion(), sorry."


Then why post?
Report Abuse
rosenburger is not online. rosenburger
Joined: 03 Aug 2009
Total Posts: 8407
16 Sep 2013 08:19 PM
"Unable to cast a value to an object"

Casting a value is like tostring() and tonumber(). I can't explain objects within 1 sentence, sorry.

~Professional ROBLOX Human
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
16 Sep 2013 08:19 PM
So what am I doing wrong?
Report Abuse
rosenburger is not online. rosenburger
Joined: 03 Aug 2009
Total Posts: 8407
16 Sep 2013 08:20 PM
@Pokemon,

I was supplying more help in a second post, I forgot to add in the first post.

~Professional ROBLOX Human
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
16 Sep 2013 08:22 PM
SO, again, what am I doing wrong?
Report Abuse
rosenburger is not online. rosenburger
Joined: 03 Aug 2009
Total Posts: 8407
16 Sep 2013 08:22 PM
What is region?

~Professional ROBLOX Human
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
16 Sep 2013 08:23 PM
According to the Object Browser/Wiki the second argument should be an Instance that has all of it's decendants ignored (not included in the returned table). Also, the max parts the method returns is 100.
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
16 Sep 2013 08:24 PM
" second argument should be an Instance that has all of it's decendants ignored"

Not sure what this means..
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
16 Sep 2013 08:25 PM
It should be an object, like a model, not a number.
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
16 Sep 2013 08:27 PM
WHat object should it be?
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
16 Sep 2013 08:35 PM
nil if you dun care
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
16 Sep 2013 08:45 PM
I tried this

local touching = false
local part = nil
local capPre = nil --capturing precent
local pos1 = Vector3.new(368.5, -26.4, -1334.5)
local pos2 = Vector3.new(417.5, -44.4, -1391.5)


while wait(0.3) do

local region = Region3.new(pos1, pos2)
local parts = game.Workspace:FindPartsInRegion3(region, nil, 100)

for i = 1, #parts do
print(parts[i].Name)
end
end


but it doesnt print anything
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
16 Sep 2013 08:47 PM
ocal touching = false
local part = nil
local capPre = nil --capturing precent
local pos1 = Vector3.new(368.5, -26.4, -1334.5)
local pos2 = Vector3.new(417.5, -44.4, -1391.5)


while wait(0.3) do

local region = Region3.new(pos1, pos2)
local parts = game.Workspace:FindPartsInRegion3(region, nil, 100)
print(#parts)
for i = 1, #parts do
print(parts[i].Name)
end
end
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
16 Sep 2013 08:50 PM
WHat did you change?
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
16 Sep 2013 08:51 PM
also it prints 0 now
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
16 Sep 2013 08:58 PM
b
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
16 Sep 2013 09:04 PM
You set the Vector3's for the Region3 wrong b/c it's saying that there aren't any parts within the Region3. That or something I'm not seeing.
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
16 Sep 2013 09:05 PM
I have 2 bricks where I got the position from. there is about 10 parts in there
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
16 Sep 2013 09:07 PM
I even tried another position but it still wont work
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
16 Sep 2013 09:12 PM
local touching = false
local part = nil
local capPre = nil --capturing precent
local pos1 = Vector3.new(368.5, -44.4, -1391.5)
local pos2 = Vector3.new(417.5, -26.4, -1334.5)


while wait(0.3) do

local region = Region3.new(pos1, pos2)
local parts = game.Workspace:FindPartsInRegion3(region, nil, 100)
print(#parts)
for i = 1, #parts do
print(parts[i].Name)
end
end
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
16 Sep 2013 09:14 PM
I even made a script that puts 2 parts at the positions. still nothing

i am `100% sure the positions are correct
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
16 Sep 2013 09:16 PM
it works now.. what did you do?
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
16 Sep 2013 09:21 PM
i cant seem to find what you changed. what did you do to make it work?
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