|
| 12 Aug 2012 07:43 AM |
| Hi, I'm making a firing range, and I need to make it so smoke would enable on a target when it's shot. To do so, I think I would need to make it enable when the bullet hits the target. How would I do this? Is their a function for a part hitting another part? |
|
|
| Report Abuse |
|
|
MrChubbs
|
  |
| Joined: 14 Oct 2010 |
| Total Posts: 4969 |
|
|
| 12 Aug 2012 07:45 AM |
function OhGodImBleedingOut() --Enable Smoke here end script.Parent.WhatEver.Touched:connect(OhGodImBleedingOut) |
|
|
| Report Abuse |
|
|
| |
|
|
| 12 Aug 2012 08:10 AM |
| Is their a way to make it so the smoke will enable whenever any brick touches it? |
|
|
| Report Abuse |
|
|
Malconer
|
  |
| Joined: 19 Feb 2009 |
| Total Posts: 1296 |
|
|
| 12 Aug 2012 08:33 AM |
| that's what that script does. |
|
|
| Report Abuse |
|
|
|
| 12 Aug 2012 08:37 AM |
Doesn't that script just make it so once the brick called "WhatEver" touches the brick called "OhGodImBleedingOut" the smoke comes out of OhGodImBleedingOut?
function OhGodImBleedingOut() --Enable Smoke here end script.Parent.WhatEver.Touched:connect(OhGodImBleedingOut) |
|
|
| Report Abuse |
|
|
Miro034
|
  |
| Joined: 07 Oct 2009 |
| Total Posts: 6568 |
|
|
| 12 Aug 2012 09:14 AM |
| No. When it is touched by the player, the function will be called. |
|
|
| Report Abuse |
|
|
|
| 13 Aug 2012 07:25 AM |
| So is their any way I can make it release smoke when it's hit by a bullet? |
|
|
| Report Abuse |
|
|
|
| 13 Aug 2012 07:28 AM |
function TargetHit(Hit) if Hit.Name == "Bullet" then --Enable Smoke end end
script.Parent.Touched:connect(TargetHit)
Replace Bullet with the Bullet's name. |
|
|
| Report Abuse |
|
|
|
| 13 Aug 2012 07:29 AM |
| Place the script directly in the block you want to be the "Target". |
|
|
| Report Abuse |
|
|
| |
|
|
| 13 Aug 2012 07:56 AM |
| Thank you so much, it works perfectly... |
|
|
| Report Abuse |
|
|
| |
|
Miro034
|
  |
| Joined: 07 Oct 2009 |
| Total Posts: 6568 |
|
| |
|