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 wont an "Explosion" happen in "local Head" ?

Previous Thread :: Next Thread 
TutorialBlox is not online. TutorialBlox
Joined: 01 Apr 2010
Total Posts: 1586
26 Sep 2013 11:21 AM
Am I inserting this Explosion into the Brick the right way?

local Head = script.Parent
local Model = script.Parent.Parent
function onClick()
local Num1 = math.random(1,9)
local Num2 = math.random(1,9)
local Num3 = math.random(1,9)
local Num4 = math.random(1,9)
local Num5 = math.random(1,9)
local Number = Num1 .. Num2 .. Num3 .. Num4 .. Num5
Model.Name = Number
if tonumber(Number) > 90000 then
Instance = Instance.new("Explosion", script.Parent)
end
end

Head.ClickDetector.MouseClick:connect(onClick)
Report Abuse
Desperian is not online. Desperian
Joined: 07 Feb 2012
Total Posts: 3371
26 Sep 2013 11:39 AM
You've not positioned the explosion.
Report Abuse
cheesecake123456 is not online. cheesecake123456
Joined: 01 Jun 2009
Total Posts: 1529
26 Sep 2013 11:57 AM
Instance.Position = Head.Position
Report Abuse
TutorialBlox is not online. TutorialBlox
Joined: 01 Apr 2010
Total Posts: 1586
26 Sep 2013 12:26 PM
Okay, so where do I add that part in my script then?
Report Abuse
LordBH is not online. LordBH
Joined: 14 Apr 2011
Total Posts: 108
26 Sep 2013 12:35 PM
anywhere explosion.Position = head.position , you can also do *CFrame.new(0,0,0) or somethin
Report Abuse
xWOWZABOYx is not online. xWOWZABOYx
Joined: 05 Aug 2010
Total Posts: 2689
26 Sep 2013 02:14 PM
Explosion.Position = Brick.Position

Sumamt like dat

Oh, and no spaces inbetween the NUM1 and .. and NUM2, etc.

【◄[ϟ]〓☜✪ xWOWZABOYx; FCOM, SQN COM, Scientist, Veteran, Visionary ✪☞〓[ϟ]►】
Report Abuse
TutorialBlox is not online. TutorialBlox
Joined: 01 Apr 2010
Total Posts: 1586
26 Sep 2013 03:51 PM
Okay that didn't work... :(
Report Abuse
digpoe is not online. digpoe
Joined: 02 Nov 2008
Total Posts: 9092
26 Sep 2013 03:54 PM
xWOWZABOYx, you can have spaces between concatonations.

print("item1 " .. "item2 ".. "item3 " .."item4 ".."item5")
Report Abuse
ItemHunt2013 is not online. ItemHunt2013
Joined: 03 Sep 2013
Total Posts: 15
26 Sep 2013 04:00 PM
pastebin
.
com
/K4K2rMbs
Report Abuse
TutorialBlox is not online. TutorialBlox
Joined: 01 Apr 2010
Total Posts: 1586
26 Sep 2013 04:02 PM
So does anyone know what the issue is here? I can't believe this simple thing is so difficult...
Report Abuse
getkoed is not online. getkoed
Joined: 18 Feb 2010
Total Posts: 2298
26 Sep 2013 04:11 PM
local Head = script.Parent
local Model = script.Parent.Parent

Head.ClicKDetector.MouseClick:connect(function()
local Num = ""
for i = 1, 5 do
Num = Num .. tostring(math.random(1, 9))
end
if tonumber(Num) > 90000 then
local Explosion = Instance.new("Explosion", Head)
Explosion.Position = Head.Position
game.Debris:AddItem(Explosion, .5)
end
end)
Report Abuse
TutorialBlox is not online. TutorialBlox
Joined: 01 Apr 2010
Total Posts: 1586
26 Sep 2013 05:15 PM
thank you getkoed for this script, but all I did need was this piece to add to mine...

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

local Explosion = Instance.new("Explosion", Head)
Explosion.Position = Head.Position
game.Debris:AddItem(Explosion, .5)

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

My question now is... are there simpler ways of saying this part of the script?
Report Abuse
TheCoolBob is not online. TheCoolBob
Joined: 10 Jul 2010
Total Posts: 459
26 Sep 2013 05:52 PM
Yep!

Bob = Instance.new("Explosion")
Bob.Parent = game.Workspace.
Bob.Position = Head.Position

Or for something simpler.

Hi javascript, can you please put an explosion in someones head when they click the click detector? Thanks!
Report Abuse
Salinas23 is not online. Salinas23
Joined: 28 Dec 2008
Total Posts: 37142
26 Sep 2013 05:56 PM
Funny how Lua is very alike to JS

I have a spider on my back.
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