|
| 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
|
  |
| Joined: 07 Feb 2012 |
| Total Posts: 3371 |
|
|
| 26 Sep 2013 11:39 AM |
| You've not positioned the explosion. |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2013 11:57 AM |
| Instance.Position = Head.Position |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2013 12:26 PM |
| Okay, so where do I add that part in my script then? |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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 |
|
|
|
| 26 Sep 2013 03:51 PM |
| Okay that didn't work... :( |
|
|
| Report Abuse |
|
|
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 |
|
|
| |
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|