|
| 27 May 2013 03:35 AM |
script.Parent.Touched:connect(function() ex = Instance.new("Explosion") ex.Position = script.Parent.Position ex.Parent = game.Workspace ex.BlastRadius = 4 ex.BlastPressure = 5e+005 end)
script.Parent.Touched:connect(function() a = game.Workspace.Part wait(2) a:remove() end)
(script.Parent is a brick in the game) |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 27 May 2013 03:42 AM |
| ok as soon as I add a mesh to the brick it brakes.... |
|
|
| Report Abuse |
|
|
|
| 27 May 2013 03:43 AM |
| it brakes when I play it then I try play it again |
|
|
| Report Abuse |
|
|
| |
|
|
| 27 May 2013 04:11 AM |
script.Parent.Touched:connect(function() ex = Instance.new("Explosion") ex.Position = script.Parent.Position ex.Parent = game.Workspace ex.BlastRadius = 4 ex.BlastPressure = 5e+005 end)
script.Parent.Touched:connect(function() a = game.Workspace.Part wait(2) a:remove() end)
Maybe this:
script.Parent.Tocued:connection(function() local ex = instance.New("Explosion", script.Parent) --Please change DIRECTORY into what it says. ex.Position = script.Parent.Position ex.Parent = game.Workspace ex.BlastRadius = 4 ex.BlastPressure = 5e+005
script.Parent.Touched:connect(function() a = script.Parent wait(2) a:remove() end)
Move the script into the part. |
|
|
| Report Abuse |
|
|
|
| 27 May 2013 06:35 AM |
So, you want to create an explosion when a part is touched?
function OnTouch(hit) if hit.Parent:findFirstChild("Humanoid")~=nil then local x=Instance.New("Explosion") x.Name="Explosion" x.Parent=game.Workspace x.BlastRadius=4 x.BlastPressure=5e+005 wait(2) script.Parent:Destroy() end end
script.Parent.Touched:connect(OnTouch(hit)) |
|
|
| Report Abuse |
|
|