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 » Scripters
Home Search
 

Re: Finding Empty Space

Previous Thread :: Next Thread 
unwarranted is not online. unwarranted
Joined: 05 Jun 2009
Total Posts: 1087
29 Dec 2015 01:30 AM
this keeps printing "finding a diff spot..." because it never finds an empty spot

function findSpot()
local randomPoint = Vector3.new(Player.Character.Torso.CFrame*CFrame.new(math.random(-5,5),0,math.random(-5,5)))
local rayCheckVisible = Ray.new(Player.Character.Torso.CFrame.p,(randomPoint-Player.Character.Torso.CFrame.p).unit * 300)
local hitSomething = workspace:FindPartOnRay(rayCheckVisible,Player.Character,false,true)
local rayCheckGround = Ray.new(randomPoint,(randomPoint*Vector3.new(0,-1000,0)-randomPoint).unit * 1000)
local hitGround,hitPos = workspace:FindPartOnRay(rayCheckGround,Player.Character,false,true)
if hitSomething then
wait()
print("finding a diff spot...")
findSpot()
elseif not hitSomething and hitGround then
print(hitPos)
return Vector3.new(hitPos)
end
end

rip indentation


mom wheres the spaghetti
Report Abuse
unwarranted is not online. unwarranted
Joined: 05 Jun 2009
Total Posts: 1087
29 Dec 2015 01:35 AM
bump[1]


mom wheres the spaghetti
Report Abuse
unwarranted is not online. unwarranted
Joined: 05 Jun 2009
Total Posts: 1087
29 Dec 2015 01:39 AM
bump[2]


mom wheres the spaghetti
Report Abuse
unwarranted is not online. unwarranted
Joined: 05 Jun 2009
Total Posts: 1087
29 Dec 2015 01:44 AM
bump[3]
pls


mom wheres the spaghetti
Report Abuse
unwarranted is not online. unwarranted
Joined: 05 Jun 2009
Total Posts: 1087
29 Dec 2015 01:48 AM
bump[4]


mom wheres the spaghetti
Report Abuse
unwarranted is not online. unwarranted
Joined: 05 Jun 2009
Total Posts: 1087
29 Dec 2015 01:55 AM
bump[5]


mom wheres the spaghetti
Report Abuse
unwarranted is not online. unwarranted
Joined: 05 Jun 2009
Total Posts: 1087
29 Dec 2015 02:00 AM
bump[6]


mom wheres the spaghetti
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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