Zerio920
|
  |
| Joined: 06 Apr 2012 |
| Total Posts: 3311 |
|
|
| 11 Sep 2013 09:25 PM |
function onTouch(obj) script.Parent.Parent.Anchored = false script.Parent.Parent.CanCollide = false game.Workspace.house.Anchored = false game.Workspace.Peeps.Anchored = false game.Workspace.Peeps.CanCollide = false local explosion = Instance.new('Explosion', Workspace) explosion.Position = Vector3.new(-17, 1050, -116) explosion.BlastPressure = 100 explosion.BlastRadius = 1000 end script.Parent.Touched:connect(onTouch)
No part of the script is working... could it be something with the function? |
|
|
| Report Abuse |
|
|
rblxxx
|
  |
| Joined: 15 Jan 2013 |
| Total Posts: 626 |
|
|
| 11 Sep 2013 09:27 PM |
function onTouch(obj) script.Parent.Parent.Anchored = false script.Parent.Parent.CanCollide = false game.Workspace.house.Anchored = false game.Workspace.Peeps.Anchored = false game.Workspace.Peeps.CanCollide = false local explosion = Instance.new("Explosion", Workspace)--This is the line that was changed. explosion.Position = Vector3.new(-17, 1050, -116) explosion.BlastPressure = 100 explosion.BlastRadius = 1000 end script.Parent.Touched:connect(onTouch) |
|
|
| Report Abuse |
|
|
janthran
|
  |
| Joined: 15 May 2009 |
| Total Posts: 17429 |
|
|
| 11 Sep 2013 09:27 PM |
Um.. What's the object tree look like? Model>Part>Script? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
Zerio920
|
  |
| Joined: 06 Apr 2012 |
| Total Posts: 3311 |
|
|
| 11 Sep 2013 09:34 PM |
@rblxxx - It still isn't working...
Maybe it's the fact that the script's supposed to activate once one block touches another one, instead of when a player touches it? |
|
|
| Report Abuse |
|
|
Zerio920
|
  |
| Joined: 06 Apr 2012 |
| Total Posts: 3311 |
|
|
| 11 Sep 2013 09:35 PM |
| When I run the script, a touchinterest appears in the brick, and when it touches the other brick, it disappears, but nothing happens. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 11 Sep 2013 09:35 PM |
| No, because something is wrong with your hierarchy. |
|
|
| Report Abuse |
|
|
rblxxx
|
  |
| Joined: 15 Jan 2013 |
| Total Posts: 626 |
|
|
| 11 Sep 2013 09:35 PM |
Maybe, try this:
function onTouched(hit) script.Parent.Parent.Anchored = false script.Parent.Parent.CanCollide = false game.Workspace.house.Anchored = false game.Workspace.Peeps.Anchored = false game.Workspace.Peeps.CanCollide = false local explosion = Instance.new("Explosion", Workspace)--This is the line that was changed. explosion.Position = Vector3.new(-17, 1050, -116) explosion.BlastPressure = 100 explosion.BlastRadius = 1000 end script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
rblxxx
|
  |
| Joined: 15 Jan 2013 |
| Total Posts: 626 |
|
|
| 11 Sep 2013 09:36 PM |
| when it says "This is the line that was changed" that line was not changed btw. |
|
|
| Report Abuse |
|
|
Zerio920
|
  |
| Joined: 06 Apr 2012 |
| Total Posts: 3311 |
|
|
| 11 Sep 2013 09:42 PM |
@Rblxxx - Same thing happens. The brick touches the other brick, nothing happens at all.
@cntkillme - Explain please? I'm not good with this stuff, so you'll have to bear with me please. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 11 Sep 2013 09:43 PM |
"game.Workspace.house.Anchored = false game.Workspace.Peeps.Anchored = false"
I'm assuming house and Peeps are not parts, but models. |
|
|
| Report Abuse |
|
|
Zerio920
|
  |
| Joined: 06 Apr 2012 |
| Total Posts: 3311 |
|
|
| 11 Sep 2013 09:48 PM |
| Yeah... you assume correct. How should I fix this? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 11 Sep 2013 09:48 PM |
For loop.
Example:
model = Game.Workspace.Model for i = 1, #model do model[i].Blah = Blah end |
|
|
| Report Abuse |
|
|
Zerio920
|
  |
| Joined: 06 Apr 2012 |
| Total Posts: 3311 |
|
|
| 11 Sep 2013 09:53 PM |
| What do I put for "Blah", and where in the script should I insert this? Also, what does it do? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 11 Sep 2013 09:54 PM |
Blah being CanCollide or whatever property you may want.
model[i] is the part inside the model. |
|
|
| Report Abuse |
|
|
Zerio920
|
  |
| Joined: 06 Apr 2012 |
| Total Posts: 3311 |
|
|
| 11 Sep 2013 10:17 PM |
So like this?
function onTouched(hit) script.Parent.Parent.Anchored = false script.Parent.Parent.CanCollide = false model = Game.Workspace.house for i = 1, #model do model[i].Anchored = False end game.Workspace.Peeps.Anchored = false game.Workspace.Peeps.CanCollide = false local explosion = Instance.new("Explosion", Workspace) explosion.Position = Vector3.new(-17, 1050, -116) explosion.BlastPressure = 100 explosion.BlastRadius = 1000 end script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 11 Sep 2013 10:19 PM |
false* And yeah, also, if Peeps is a model, you should do the same with it. |
|
|
| Report Abuse |
|
|
|
| 12 Sep 2013 06:13 AM |
Note: CanCollide Bricks can't be activated with the "Touched" event.
--Blame John |
|
|
| Report Abuse |
|
|
Vrakner
|
  |
| Joined: 19 Feb 2013 |
| Total Posts: 323 |
|
| |
|
|
| 12 Sep 2013 06:25 AM |
| Yeah, they can...I died touching a non collidable lava brick. lal. |
|
|
| Report Abuse |
|
|