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
 

"Raycast Explosion"

Previous Thread :: Next Thread 
seanb117 is not online. seanb117
Joined: 03 Feb 2010
Total Posts: 1020
24 May 2013 06:25 PM
How would you go about making a raycast explosion? Like making a bunch of rays hit Characters within a certain radius during an explosion.
Report Abuse
dog456pop248 is not online. dog456pop248
Joined: 24 Aug 2008
Total Posts: 3977
24 May 2013 06:31 PM
Why not just use a normal explosion...
Report Abuse
seanb117 is not online. seanb117
Joined: 03 Feb 2010
Total Posts: 1020
24 May 2013 06:35 PM
Well, because it sucks when you have vehicles that you don't want to break apart just because an explosion happens. It causing massive lag depending on the vehicle, and kills people inside of a armored vehicle. Its more realistic to make a new explosion that makes a ray to all characters within a certain radius. Thus not killing those in an explosion while in an unanchored vehicle. Protecting them from harm.
Report Abuse
TheGamer101 is not online. TheGamer101
Joined: 14 Feb 2009
Total Posts: 11943
24 May 2013 06:40 PM
Use magnitude to find characters in the radius of your explosion. Then draw rays between the center of the blast and the character's torso to make sure there isn't a wall in the way.
Report Abuse
seanb117 is not online. seanb117
Joined: 03 Feb 2010
Total Posts: 1020
24 May 2013 06:45 PM
I know how to do it in a way, but I'm not sure how I'd do it for multiple people at the same time..
Report Abuse
TheGamer101 is not online. TheGamer101
Joined: 14 Feb 2009
Total Posts: 11943
24 May 2013 06:45 PM
Use a for loop to cycle through all the players.
Report Abuse
dog456pop248 is not online. dog456pop248
Joined: 24 Aug 2008
Total Posts: 3977
24 May 2013 06:47 PM
Also, for exploding vehicles...
You can make the blast pressure 0 and still be able to check if the player was hit by the explosion, hurting players but not the environment.
Report Abuse
seanb117 is not online. seanb117
Joined: 03 Feb 2010
Total Posts: 1020
24 May 2013 06:47 PM
I don't think that'd be fast enough to hit all at the same time.
Report Abuse
StealthKing95 is not online. StealthKing95
Joined: 13 Dec 2008
Total Posts: 4263
24 May 2013 07:15 PM
You dont need raycasting for this.
For your surprise, I have already created this!

function recursionPartList(obj)
local oL = {}
for i,v in pairs(obj:children()) do
if (v:IsA'Part' or v:IsA'WedgePart' or v:IsA'Seat' or v:IsA'VehicleSeat' or v:IsA'CornerWedgePart') then
oL[i] = v
else
recursionPartList(v)
end
end
return oL
end

function phys_explosion(Pos,Rad,Pres,Par)
local objectList = recursionPartList(Par)
for i,v in pairs(objectList) do
if (not v.Anchored) and (v.Position-Pos).magnitude < Rad then
v:BreakJoints()
v.Anchored = true
v.Velocity = (v.Position - Pos).unit * (Pres / (v.Position - Pos).magnitude)
v.Anchored = false
print(v.Velocity)
end
end
end


phys_explosion(Vector3.new(0,0,0),32,1000,workspace)
Report Abuse
killjoy37 is not online. killjoy37
Joined: 27 Aug 2008
Total Posts: 2821
24 May 2013 07:51 PM
Like the guy above said, make the blast pressure 0 and use Explosion.Hit
Report Abuse
StealthKing95 is not online. StealthKing95
Joined: 13 Dec 2008
Total Posts: 4263
24 May 2013 08:57 PM
^ what???
Report Abuse
seanb117 is not online. seanb117
Joined: 03 Feb 2010
Total Posts: 1020
24 May 2013 11:54 PM
Stealth, how exactly would you use that script..its confusing it looks nothing like an explosion script haha.
And I looked into the Explosion.Hit event, it has a script for it already but doesn't factor in parts between the character and the explosion position
Report Abuse
dog456pop248 is not online. dog456pop248
Joined: 24 Aug 2008
Total Posts: 3977
24 May 2013 11:56 PM
@Sean

You don't know what an "explosion script" looks like because there is no such thing.

Report Abuse
seanb117 is not online. seanb117
Joined: 03 Feb 2010
Total Posts: 1020
24 May 2013 11:56 PM
Okay it does, My bad. xD Still confusing though :P
Report Abuse
seanb117 is not online. seanb117
Joined: 03 Feb 2010
Total Posts: 1020
24 May 2013 11:58 PM
By explosion script, I meant a script that goes into a projectile that creates an Explosion when it hits something.
Report Abuse
StealthKing95 is not online. StealthKing95
Joined: 13 Dec 2008
Total Posts: 4263
25 May 2013 06:40 AM
I gave the framework. The bottom of my script tells you how to use it.

I would suggest learning about functions.
Report Abuse
seanb117 is not online. seanb117
Joined: 03 Feb 2010
Total Posts: 1020
25 May 2013 02:13 PM
I know that, but theres absolutely no instruction for it. From what I can tell anyways.
Report Abuse
StealthKing95 is not online. StealthKing95
Joined: 13 Dec 2008
Total Posts: 4263
25 May 2013 05:00 PM
phys_explosion(Vector3(0,0,0),32,1000,workspace)

phys_explosion(position,radius,pressure,location)

is this enough documentation?
Report Abuse
seanb117 is not online. seanb117
Joined: 03 Feb 2010
Total Posts: 1020
26 May 2013 01:02 AM
I wasn't referring to that part. I know what that is. I meant everything above it. Like what exactly does it do?
Report Abuse
GuestCapone is not online. GuestCapone
Joined: 19 Oct 2012
Total Posts: 1928
26 May 2013 03:09 AM
hmm
If I wasn't on my phone atm I would take the script and post it into a working model...
D:

Have to do that tomorrow :/
Report Abuse
StealthKing95 is not online. StealthKing95
Joined: 13 Dec 2008
Total Posts: 4263
26 May 2013 10:43 AM
Its an explosion, without the effect, and it doesnt break joints
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