Jezbob
|
  |
| Joined: 19 Nov 2008 |
| Total Posts: 764 |
|
|
| 28 Oct 2011 07:38 AM |
Hi,
Was just wandering if this script would work. Also, would my function work? ------------------------------------------------------------------------------------------
function ontouch(part) -- Doubt the function fits in well with this. x=Instance.new("Explosion") x.BlastRadius = 100 x.BlastPressure = 100 x.Parent = game.Workspace x.Position = Vector3.new(1, 1, 1) end
script.parent.Touched:connect(onTouch)
------------------------------------------------------------------------------------------
Basically, when a person touches a brick an expolsion is supposed to happen:/
Just as a question, how would I get the expolsion to spawn at the bricks coordinates other than finding out the brick coordinates? Is there another way?
Thanks, |
|
|
| Report Abuse |
|
|
Jezbob
|
  |
| Joined: 19 Nov 2008 |
| Total Posts: 764 |
|
|
| 28 Oct 2011 07:42 AM |
| Oh yeah, also, do "while"'s have to have ends? |
|
|
| Report Abuse |
|
|
1WOOF1
|
  |
| Joined: 03 May 2009 |
| Total Posts: 20682 |
|
| |
|
Jezbob
|
  |
| Joined: 19 Nov 2008 |
| Total Posts: 764 |
|
|
| 28 Oct 2011 07:45 AM |
| Good, on my other post with a function and a while I put one end and when people pointed that out I was unsure so ty:) |
|
|
| Report Abuse |
|
|
NXTBoy
|
  |
| Joined: 25 Aug 2008 |
| Total Posts: 4533 |
|
|
| 28 Oct 2011 07:46 AM |
Yes, they do.
You need to be careful with your capital letters. `.parent` is not the same as `.Parent`, nor is `ontouch` the same as `onTouch:
local thingThatExplodes = script.Parent function onTouch(part) local e = Instance.new("Explosion") e.BlastRadius = 100 e.BlastPressure = 100 e.Position = thingThatExplodes.Position e.Parent = game.Workspace end thingThatExplodes.Touched:connect(onTouch) |
|
|
| Report Abuse |
|
|
Jezbob
|
  |
| Joined: 19 Nov 2008 |
| Total Posts: 764 |
|
|
| 28 Oct 2011 07:48 AM |
| Yeah, that was me typing but I really need to stop doing that... |
|
|
| Report Abuse |
|
|