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: Whats wrong with this?

Previous Thread :: Next Thread 
SquirrelMan is not online. SquirrelMan
Joined: 01 May 2008
Total Posts: 33
28 Aug 2011 06:48 PM
Whats wrong with this script?:
--------------------------------------------------------
brick = workspace.brick

function onTouch(hit)
hum = hit.Parent:findFirstChild("Humanoid")
if hum ~= nil then
Instance.new('Explosion')
Explosion.Parent = brick
end

brick.Touched:connect(ontouch)
----------------------------------------------------------
Report Abuse
pwnedu46 is not online. pwnedu46
Joined: 23 May 2009
Total Posts: 7534
28 Aug 2011 06:55 PM
There are a **LOT** of things that're wrong with it.


`

brick = game.Workspace.Brick

brick.Touched:connect(function(hit)
plr = game.Players:getPlayerFromCharacter(hit.Parent)
if plr then
local bewm = Instance.new("Explosion", game.Workspace)
bewm.BlastPressure = 1e5
bewm.BlastRadius = 3
bewm.Position = brick.Position
wait(1)
bewm:Remove()
end
end)


`
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
28 Aug 2011 08:26 PM
YOu have to look more aobut explosion properties.
Report Abuse
GoldenUrg is not online. GoldenUrg
Joined: 23 Aug 2009
Total Posts: 6428
28 Aug 2011 10:08 PM
The main thing that's wrong is
brick.Touched:connect(ontouch)
should be
brick.Touched:connect(onTouch) -- name must match exactly including case

It is not necessary to inline the function or to use a particular form of workspace (Workspace, Game.Workspace, and workspace all work as well as game.Workspace)
Report Abuse
TigerBloodd is not online. TigerBloodd
Joined: 24 Oct 2010
Total Posts: 2430
28 Aug 2011 10:14 PM
StrengthOfExplosion = 1e5
RadiusOfExplosion = 3
>brick = game.Workspace.Brick
>brick.Touched:connect(function(hit)
>plr = game.Players:GetPlayerFromCharacter(hit.Parent)
>if plr then
>local ex = Instance.new("Explosion", game.Workspace)
>ex.BlastPressure = StrengthOfExplosion
>ex.BlastRadius = RadiusOfExplosion
>ex.Position = brick.Position
>end
>end)
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
29 Aug 2011 04:04 PM
I think he figured it out now.
Report Abuse
SquirrelMan is not online. SquirrelMan
Joined: 01 May 2008
Total Posts: 33
09 Sep 2011 07:07 PM
Thanks Guys! Especially those eho explained it to me! Though ive given up on an explosion brick because im looking into something bigger (hint: they both have to do with Doctor Who)
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
09 Sep 2011 07:11 PM
-___-

Well...Ok?Good luck
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