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: Can I have help with this script?

Previous Thread :: Next Thread 
TheRealGlobotLeader is not online. TheRealGlobotLeader
Joined: 23 Feb 2011
Total Posts: 5106
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
TheRealGlobotLeader is not online. TheRealGlobotLeader
Joined: 23 Feb 2011
Total Posts: 5106
24 Aug 2012 09:56 AM
can someone fix this?*
Report Abuse
Zomebody is not online. 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
TheRealGlobotLeader is not online. TheRealGlobotLeader
Joined: 23 Feb 2011
Total Posts: 5106
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
TheRealGlobotLeader is not online. TheRealGlobotLeader
Joined: 23 Feb 2011
Total Posts: 5106
24 Aug 2012 10:03 AM
It doesn't say the line.
Report Abuse
GeniusBuilder is not online. GeniusBuilder
Joined: 20 Jan 2010
Total Posts: 2159
24 Aug 2012 10:06 AM
Is the script inside a brick?
Report Abuse
Zomebody is not online. 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
TheRealGlobotLeader is not online. TheRealGlobotLeader
Joined: 23 Feb 2011
Total Posts: 5106
24 Aug 2012 10:08 AM
I replaced it with a number and it still isn't working.
Report Abuse
bob354293 is not online. 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
TheRealGlobotLeader is not online. TheRealGlobotLeader
Joined: 23 Feb 2011
Total Posts: 5106
24 Aug 2012 10:13 AM
Ok
Report Abuse
TheRealGlobotLeader is not online. TheRealGlobotLeader
Joined: 23 Feb 2011
Total Posts: 5106
24 Aug 2012 10:15 AM
It's in my Sentry Testing game...When you are done please make it a model.
Report Abuse
leolion113 is not online. leolion113
Joined: 11 Oct 2008
Total Posts: 3336
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
TheRealGlobotLeader is not online. TheRealGlobotLeader
Joined: 23 Feb 2011
Total Posts: 5106
24 Aug 2012 10:45 AM
Thanks.
Report Abuse
StealthKing95 is not online. StealthKing95
Joined: 13 Dec 2008
Total Posts: 4263
24 Aug 2012 10:48 AM
Isnt it math.huge() ?
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