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: Could a script tell if a brick hits an explosion?

Previous Thread :: Next Thread 
extremeninjamaster is not online. extremeninjamaster
Joined: 25 Feb 2012
Total Posts: 2570
19 Mar 2014 12:29 PM
Hi I'm making a game that involves a script that makes a thing happen if a brick touches an explosion. I tried using a Touch detector but it didn't register if i shot a rocket launcher at the brick.

Any help?
Report Abuse
extremeninjamaster is not online. extremeninjamaster
Joined: 25 Feb 2012
Total Posts: 2570
19 Mar 2014 12:31 PM
Please?
Report Abuse
Kingmouli is not online. Kingmouli
Joined: 28 Sep 2012
Total Posts: 1292
19 Mar 2014 12:32 PM
Look up the Hit event on the wiki
Report Abuse
extremeninjamaster is not online. extremeninjamaster
Joined: 25 Feb 2012
Total Posts: 2570
19 Mar 2014 12:36 PM
Yeah but i need the brick to react to any explosion not a script-made explosion
Report Abuse
extremeninjamaster is not online. extremeninjamaster
Joined: 25 Feb 2012
Total Posts: 2570
19 Mar 2014 12:37 PM
You know what i mean?
Report Abuse
Kingmouli is not online. Kingmouli
Joined: 28 Sep 2012
Total Posts: 1292
19 Mar 2014 12:40 PM
Hit event
Check if the part that hit the explosion is the part you wanna destroy
Destroy it.

Also, a strong explosion will separate bricks that are unanchored and joined together with glue without any script.
Report Abuse
extremeninjamaster is not online. extremeninjamaster
Joined: 25 Feb 2012
Total Posts: 2570
19 Mar 2014 12:43 PM
Okay so how do i make it so that if a explosion hits a part the part dissappears?
Report Abuse
extremeninjamaster is not online. extremeninjamaster
Joined: 25 Feb 2012
Total Posts: 2570
19 Mar 2014 12:47 PM
Ok so here is what i have so far:

function onTouched(hit)
local Prize = game.Lighting.BlowBuck
local HitName = hit.Name
local HitLocation = hit.Position
local P = script.Parent
if HitName == ("Explosion") then
wait(0.5)
P.BrickColor = BrickColor3.New ("Black")
P.Transparancy = 0.5
wait(0.1)
P.Transparancy = 0.6
wait(0.1)
P.Transparancy = 0.8
wait(0.1)
P.Transparancy = 1
wait(0.1)
Prize:Clone(game.Workspace)
Prize.Position = HitLocation
P:Destroy()
else
return nil
end
end

script.Parent.Touched:connect(onTouched)

I want this function to be called when an explosion hits it.
But checking if it is called "Explosion" Doesn't do anything. Any help?
Report Abuse
idyllically is not online. idyllically
Joined: 13 Mar 2010
Total Posts: 4622
19 Mar 2014 12:50 PM
The hit event won't work. The hit event runs when a part hits another part. I suggest you determine the range an explosion has and use magnitude to destroy all parts within its range. I'll get you started.

game.Workspace.ChildAdded:connect(function(thing)
if thing.ClassName == "Explosion" then
radius = thing.BlastRadius

From then on, it's up to you. I'm too lazy to do some magnitude stuff.

Outfoxing Foxes
Report Abuse
extremeninjamaster is not online. extremeninjamaster
Joined: 25 Feb 2012
Total Posts: 2570
19 Mar 2014 12:54 PM
Wait... magnitude wha?

Oh whatever. I will just do it the booby way and make it so that a explosion spawns a invisible brick that is as big as the explosion and have it react to THAT touching it :3
Report Abuse
Kingmouli is not online. Kingmouli
Joined: 28 Sep 2012
Total Posts: 1292
19 Mar 2014 01:34 PM
"The hit event runs when a part hits another part"

Don't you mean touched? And why not Hit event.
Report Abuse
robomax11 is not online. robomax11
Joined: 07 Jul 2011
Total Posts: 6828
19 Mar 2014 01:59 PM
ur brick cant hit a frkn exsplosion


use .magnitude to check everything around and see if .ClassName or :IsA('Explosion')
kk
Report Abuse
Vulcain is not online. Vulcain
Joined: 18 Oct 2010
Total Posts: 42
19 Mar 2014 02:01 PM
They mean the Hit event for an Explosion class.

local Explosion = Instance.new("Explosion",workspace)

Explosion.Hit:connect(function(part)
if (part.Name=="PART NAME") then
part:Destroy()
end end)
Report Abuse
Kingmouli is not online. Kingmouli
Joined: 28 Sep 2012
Total Posts: 1292
19 Mar 2014 02:05 PM
A brick can't touch a frickin explosion
An explosion can hit a brick
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