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: Why does this not work?

Previous Thread :: Next Thread 
NiceCake123 is not online. NiceCake123
Joined: 24 Dec 2011
Total Posts: 972
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
Destiny1147 is not online. Destiny1147
Joined: 08 Jun 2011
Total Posts: 699
27 May 2013 03:40 AM
It works, I tested.
Report Abuse
NiceCake123 is not online. NiceCake123
Joined: 24 Dec 2011
Total Posts: 972
27 May 2013 03:41 AM
Strange it does now....
Report Abuse
NiceCake123 is not online. NiceCake123
Joined: 24 Dec 2011
Total Posts: 972
27 May 2013 03:42 AM
ok as soon as I add a mesh to the brick it brakes....
Report Abuse
NiceCake123 is not online. NiceCake123
Joined: 24 Dec 2011
Total Posts: 972
27 May 2013 03:43 AM
it brakes when I play it then I try play it again
Report Abuse
NiceCake123 is not online. NiceCake123
Joined: 24 Dec 2011
Total Posts: 972
27 May 2013 03:45 AM
help
Report Abuse
SharpUserKnifeIV is not online. SharpUserKnifeIV
Joined: 03 Apr 2013
Total Posts: 1398
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
Wreckerbuster67 is not online. Wreckerbuster67
Joined: 29 Jul 2012
Total Posts: 1144
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
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