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: Explosions

Previous Thread :: Next Thread 
GRAGGER2001 is not online. GRAGGER2001
Joined: 05 Apr 2009
Total Posts: 2043
24 Jul 2013 09:55 AM
What do I put in this script so it explodes when it touches something.

local Part = script.Parent
Part.Touched:connect(function(Hit)
Hit.
end
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
24 Jul 2013 09:58 AM
Part = script.Parent
t = false
Part.Touched:connect(function(Hit)
if t == false then
t = true
local ex = Instance.new("Explosion",Workspace)
ex.Position = Part.Position
t = false
end
end
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
24 Jul 2013 09:58 AM
Instance.new("Explosion", Workspace).Position = Hit.Position

Fix: "end)"
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
24 Jul 2013 09:58 AM
Oops, one more thing:

Part = script.Parent
t = false
Part.Touched:connect(function(Hit)
if t == false then
t = true
local ex = Instance.new("Explosion",Workspace)
ex.Position = Part.Position
t = false
end
end)
Report Abuse
GRAGGER2001 is not online. GRAGGER2001
Joined: 05 Apr 2009
Total Posts: 2043
24 Jul 2013 09:59 AM
How would I insert that script into a part that is inserted from a script?
Report Abuse
100465 is not online. 100465
Joined: 17 Jun 2010
Total Posts: 6353
24 Jul 2013 10:00 AM
function onTouched(part)
local hum = part.Parent:findFirstChild(Humanoid)
if hum ~= nil then
Instance.new("Explosion", game.Workspace.part.Parent)
end


Thats for humanoids only.

Im not random, my mind just works faster than yours.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
24 Jul 2013 10:00 AM
uBEmissingANendANDaCONNECTOR
Report Abuse
100465 is not online. 100465
Joined: 17 Jun 2010
Total Posts: 6353
24 Jul 2013 10:03 AM
Whoops forgot the last lines.

Im not random, my mind just works faster than yours.
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