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: Detect explosion

Previous Thread :: Next Thread 
beeflord is not online. beeflord
Joined: 06 Jun 2009
Total Posts: 3372
04 Nov 2011 07:16 AM
Can a script detect when it is hit by a explosion?
Like for example,

if script.Parent:Touchedbyaexplosion then
script.Parent.Remove()
Report Abuse
ZizZazZuz is not online. ZizZazZuz
Joined: 16 Jun 2008
Total Posts: 2743
04 Nov 2011 07:18 AM
Try Explosion.Hit
Report Abuse
beeflord is not online. beeflord
Joined: 06 Jun 2009
Total Posts: 3372
04 Nov 2011 07:23 AM
if script.Parent.Explosion.Hit then
script.Parent.Remove()

Like that?
Report Abuse
beeflord is not online. beeflord
Joined: 06 Jun 2009
Total Posts: 3372
04 Nov 2011 08:37 AM
Please help.
Report Abuse
ZizZazZuz is not online. ZizZazZuz
Joined: 16 Jun 2008
Total Posts: 2743
04 Nov 2011 08:43 AM
It's an event.

script.Parent.Hit:connect(function (instance, distanceFromBoom)
end)
Report Abuse
beeflord is not online. beeflord
Joined: 06 Jun 2009
Total Posts: 3372
04 Nov 2011 09:15 AM
How do I put it all together in one script?
Report Abuse
ZizZazZuz is not online. ZizZazZuz
Joined: 16 Jun 2008
Total Posts: 2743
04 Nov 2011 09:19 AM
Excuse me?
Report Abuse
beeflord is not online. beeflord
Joined: 06 Jun 2009
Total Posts: 3372
04 Nov 2011 09:22 AM
How do I put it together in a script so it works? I cant make it work because I dont know whats first and last.
Report Abuse
ZizZazZuz is not online. ZizZazZuz
Joined: 16 Jun 2008
Total Posts: 2743
04 Nov 2011 09:23 AM
What do you want it to do?
Report Abuse
beeflord is not online. beeflord
Joined: 06 Jun 2009
Total Posts: 3372
04 Nov 2011 09:24 AM
I want a brick to be deleted if it is touched by a explosion.
Report Abuse
beeflord is not online. beeflord
Joined: 06 Jun 2009
Total Posts: 3372
04 Nov 2011 09:42 AM
Help please.
Report Abuse
ZizZazZuz is not online. ZizZazZuz
Joined: 16 Jun 2008
Total Posts: 2743
04 Nov 2011 09:42 AM
script.Parent.Hit:connect(function (hit, dis) hit:remove() end
Report Abuse
ZizZazZuz is not online. ZizZazZuz
Joined: 16 Jun 2008
Total Posts: 2743
04 Nov 2011 09:43 AM
Oops, I meant script.Parent.Hit:connect(function (hit, dis) hit:remove() end)


DAAAAAAII FLOOOOOODCHEEEEEEEECK!
Y U nu dai?
Report Abuse
beeflord is not online. beeflord
Joined: 06 Jun 2009
Total Posts: 3372
04 Nov 2011 09:43 AM
Thank you.
Report Abuse
beeflord is not online. beeflord
Joined: 06 Jun 2009
Total Posts: 3372
04 Nov 2011 09:45 AM
Wait, I need it to be removed by explosions only and the script is supposed to be inside the removed brick.
Report Abuse
ZizZazZuz is not online. ZizZazZuz
Joined: 16 Jun 2008
Total Posts: 2743
04 Nov 2011 09:46 AM
Oh, not, you gotta put the script in the explosion.
Report Abuse
ZizZazZuz is not online. ZizZazZuz
Joined: 16 Jun 2008
Total Posts: 2743
04 Nov 2011 09:47 AM
script.Parent.Hit:connect(function (hit, dis)
if hit.Name = "Designation here" then
hit:remove()
end
end


you should be able to choose which bricks are removed by name.
Report Abuse
ZizZazZuz is not online. ZizZazZuz
Joined: 16 Jun 2008
Total Posts: 2743
04 Nov 2011 09:48 AM
Oops, I meant:

script.Parent.Hit:connect(function (hit, dis)
if hit.Name = "Designation here" then
hit:remove()
end
end)

e.e
Report Abuse
beeflord is not online. beeflord
Joined: 06 Jun 2009
Total Posts: 3372
04 Nov 2011 09:49 AM
Instead of

script.Parent.Hit:connect(function (hit, dis)
if hit.Name = "Designation here" then
hit:remove()
end
end)

Shouldnt it be

script.Parent.Hit:connect(function (hit, dis)
if hit.Type = "Explosion" then
script.Parent:remove()
end
end)
Report Abuse
ZizZazZuz is not online. ZizZazZuz
Joined: 16 Jun 2008
Total Posts: 2743
04 Nov 2011 09:51 AM
Erm, no, the script MUST be in the explosion. :S
Report Abuse
beeflord is not online. beeflord
Joined: 06 Jun 2009
Total Posts: 3372
04 Nov 2011 09:51 AM
It says "Hit is not a valid member of part"

script.Parent.Hit:connect(function (hit, dis)
if hit.ClassName == "Explosion" then
script.Parent:remove()
end
end)
Report Abuse
ZizZazZuz is not online. ZizZazZuz
Joined: 16 Jun 2008
Total Posts: 2743
04 Nov 2011 09:51 AM
Derp.
Report Abuse
beeflord is not online. beeflord
Joined: 06 Jun 2009
Total Posts: 3372
04 Nov 2011 09:51 AM
Ok. So with a rocket launcher, how am I supposed to give the explosion a script?
Report Abuse
ZizZazZuz is not online. ZizZazZuz
Joined: 16 Jun 2008
Total Posts: 2743
04 Nov 2011 09:54 AM
Find the rocket explosion script and connect the function to the explosion the rocket creates. Put it before it's parented to Workspace.
Report Abuse
beeflord is not online. beeflord
Joined: 06 Jun 2009
Total Posts: 3372
04 Nov 2011 09:58 AM
Ok I found it, how do I clone it into the rocket?

local hitterScript = game.Lightning.theScript
--clone script here
hitterscript.Parent = Rocket
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