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: Roof detection script

Previous Thread :: Next Thread 
phoniex is not online. phoniex
Joined: 03 Feb 2008
Total Posts: 34985
07 Apr 2013 09:03 AM
Is it possible to make a script that detects when a player is under a block that is shielding them from the sky?

~Rock is dead. Long live paper and scissors!~
Report Abuse
funnymouse7 is not online. funnymouse7
Joined: 17 Mar 2011
Total Posts: 1741
07 Apr 2013 09:11 AM
put a cancollidable brick unther the brick shielding him from the sky and then check if the player is touching that brick

~Life has two keys to success one of them is patience the other one is under the carpet infront of my doorstep.
Report Abuse
funnymouse7 is not online. funnymouse7
Joined: 17 Mar 2011
Total Posts: 1741
07 Apr 2013 09:11 AM
reply if you understand it or not please

~Life has two keys to success one of them is patience the other one is under the carpet infront of my doorstep.
Report Abuse
phoniex is not online. phoniex
Joined: 03 Feb 2008
Total Posts: 34985
07 Apr 2013 09:12 AM
That won't work for what I have in mind

~Rock is dead. Long live paper and scissors!~
Report Abuse
funnymouse7 is not online. funnymouse7
Joined: 17 Mar 2011
Total Posts: 1741
07 Apr 2013 09:22 AM
and what is it that you have in mind?>

~Life has two keys to success one of them is patience the other one is under the carpet infront of my doorstep.
Report Abuse
digpoe is not online. digpoe
Joined: 02 Nov 2008
Total Posts: 9092
07 Apr 2013 09:24 AM
Use Magnitude on a part in the middle of the 'room'. If the player is within a distance, then consider him under shelter.

You could also use Region3, with the house as the Ignore list.
Report Abuse
THEBobMcBobbingston is not online. THEBobMcBobbingston
Joined: 26 Feb 2011
Total Posts: 123
07 Apr 2013 09:30 AM
Probably a really inefficient/stupid way of doing it, but you could raycast up from the head and see if it hits blocks (that aren't hats, just in case).
Report Abuse
digpoe is not online. digpoe
Joined: 02 Nov 2008
Total Posts: 9092
07 Apr 2013 09:34 AM
That would actually be a better way than magnitude/Region3.

You would raycast from the head's position going up, and if there's a part named 'shelter' above it, consider the player under shelter.
Report Abuse
THEBobMcBobbingston is not online. THEBobMcBobbingston
Joined: 26 Feb 2011
Total Posts: 123
07 Apr 2013 09:35 AM
@Dig,

Yay, my suggestion was useful. =)
Report Abuse
phoniex is not online. phoniex
Joined: 03 Feb 2008
Total Posts: 34985
07 Apr 2013 09:40 AM
Thanks, guys

~Rock is dead. Long live paper and scissors!~
Report Abuse
tyzone is not online. tyzone
Joined: 16 Aug 2008
Total Posts: 1726
07 Apr 2013 09:45 AM
Make sure the raycast has nothing to do with the Head's lookVector, and works with the actual and, eh, "global" Y axis. Because if the player trips, the raycast would fly around and probably hit the floor a few times.

That would be an useful script. You could make a GUI with snow animation, for instance, that fades out when you're in a shelter. Also, if you add parts like a metal grid above the person (where there's a brick above them, but they're not really under shelter), then I would suggest giving the "Shelter Roof" parts a specific name, and making the script return the name of the brick to make sure it should work.
Because yeah, it would also make you be "under shelter" if someone standed on your head, then.
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