|
| 24 Aug 2012 09:55 AM |
print("Self Destruct Console Loaded") countdown = true -- The countdown is optional so if you don't want a countdown prior to the explosion change this value to false. time = 600 -- This is the default time the countdown is set too. local h = Instance.new("Hint",Workspace) function Explosion() local e = Instance.new("Explosion",Workspace) --makes an explosion e.Position = script.Parent.Position e.BlastRadius = math.huge --makes explosion huge e.BlastPressure = math.huge wait(1) script.Parent.Destruction.Disabled = false h.Text = "Detonation completed." --tells everyone that the detonation has completed h:remove() end function StartCountdown() h.Text = "Countdown Initiated" for i = time, 1, -1 do -- i = The time you need to wait for the explosion. h.Text = "Detonation in: ".. tostring(i) .."" wait(1) Explosion() end function Click() if countdown == false then Explosion() elseif countdown == true then StartCountdown() end end end script.Parent.ClickDetector.MouseClick:connect(Click)
--For some reason this script doesn't work the output keeps telling me to attempt to call a nil value but I am not sure where to do that. Can someone fixt his? |
|
|
| Report Abuse |
|
|
| |
|
Zomebody
|
  |
| Joined: 01 Jun 2010 |
| Total Posts: 789 |
|
|
| 24 Aug 2012 10:01 AM |
| If you told us the line the mistake's in, people are more willing to look at it. It should say in the output. We're not going to read through the whole text... |
|
|
| Report Abuse |
|
|
|
| 24 Aug 2012 10:03 AM |
I'll tell you what comes up:
11:02:08 - attempt to call a nil value 11:02:08 - Disconnected event because of exception |
|
|
| Report Abuse |
|
|
| |
|
|
| 24 Aug 2012 10:06 AM |
| Is the script inside a brick? |
|
|
| Report Abuse |
|
|
Zomebody
|
  |
| Joined: 01 Jun 2010 |
| Total Posts: 789 |
|
|
| 24 Aug 2012 10:06 AM |
| maybe it has something to do with math.huge. You should replace it with a number and tell me what happens. You can't have an explosion that's unendingly big. |
|
|
| Report Abuse |
|
|
|
| 24 Aug 2012 10:08 AM |
| I replaced it with a number and it still isn't working. |
|
|
| Report Abuse |
|
|
bob354293
|
  |
| Joined: 26 Oct 2008 |
| Total Posts: 2609 |
|
|
| 24 Aug 2012 10:11 AM |
put the script and all the bricks in a game, uncopylock it, ill go on and fix for you if you like...
~ + 1 Cookie for me. - 1 cookie for you. :D ~ |
|
|
| Report Abuse |
|
|
| |
|
|
| 24 Aug 2012 10:15 AM |
| It's in my Sentry Testing game...When you are done please make it a model. |
|
|
| Report Abuse |
|
|
|
| 24 Aug 2012 10:28 AM |
countdown = true time = 600
function Explosion() local e = Instance.new("Explosion",Workspace) e.Position = script.Parent.Position e.BlastRadius = 100 e.BlastPressure = 50000 wait(1) script.Parent.Destruction.Disabled = false h = Instance.new("Hint",Workspace) h.Text = "Detonation completed." h:remove() end
function StartCountdown() h = Instance.new("Hint",Workspace) h.Text = "Countdown Initiated" for i = time, 1, -1 do wait(1) h.Text = "Detonation in: ".. tostring(i) end Explosion() h:Remove() end
function Click() if countdown == false then Explosion() elseif countdown == true then StartCountdown() end end script.Parent.ClickDetector.MouseClick:connect(Click)
You've also got an issue in your 'TopScreen' (Look at the 3rd line closely). |
|
|
| Report Abuse |
|
|
| |
|
| |
|