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: Would this work? (Noob scripter + Script)

Previous Thread :: Next Thread 
Jezbob is not online. Jezbob
Joined: 19 Nov 2008
Total Posts: 764
28 Oct 2011 07:38 AM
Hi,

Was just wandering if this script would work. Also, would my function work?
------------------------------------------------------------------------------------------

function ontouch(part) -- Doubt the function fits in well with this.
x=Instance.new("Explosion")
x.BlastRadius = 100
x.BlastPressure = 100
x.Parent = game.Workspace
x.Position = Vector3.new(1, 1, 1)
end

script.parent.Touched:connect(onTouch)

------------------------------------------------------------------------------------------

Basically, when a person touches a brick an expolsion is supposed to happen:/

Just as a question, how would I get the expolsion to spawn at the bricks coordinates other than finding out the brick coordinates? Is there another way?

Thanks,
Report Abuse
Jezbob is not online. Jezbob
Joined: 19 Nov 2008
Total Posts: 764
28 Oct 2011 07:42 AM
Oh yeah, also, do "while"'s have to have ends?
Report Abuse
1WOOF1 is not online. 1WOOF1
Joined: 03 May 2009
Total Posts: 20682
28 Oct 2011 07:44 AM
[ Content Deleted ]
Report Abuse
Jezbob is not online. Jezbob
Joined: 19 Nov 2008
Total Posts: 764
28 Oct 2011 07:45 AM
Good, on my other post with a function and a while I put one end and when people pointed that out I was unsure so ty:)
Report Abuse
NXTBoy is not online. NXTBoy
Joined: 25 Aug 2008
Total Posts: 4533
28 Oct 2011 07:46 AM
Yes, they do.

You need to be careful with your capital letters. `.parent` is not the same as `.Parent`, nor is `ontouch` the same as `onTouch:

    local thingThatExplodes = script.Parent
    
    function onTouch(part)
        local e = Instance.new("Explosion")
        e.BlastRadius = 100
        e.BlastPressure = 100
        e.Position = thingThatExplodes.Position
        e.Parent = game.Workspace
    end
    thingThatExplodes.Touched:connect(onTouch)
Report Abuse
Jezbob is not online. Jezbob
Joined: 19 Nov 2008
Total Posts: 764
28 Oct 2011 07:48 AM
Yeah, that was me typing but I really need to stop doing that...
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