I made a nuke and want it to detonate 60 seconds after I press a button. However, when I test the game it explodes instantly after I spawn. What would I add to make this work? (Also: The script is rather long and complex)
http://imgur.com/K9rOxNe,owGO5CC,mbmCAXa#0
(NOTE: The script wont show up right so I attached 3 pictures showing it in the link above)
EDITED
Try this out:
local button = --locate your button (the button that you press to start explosion) function a() wait(60) local explode = Instance.new("Explosion") explode.Parent = -- Put the block you want it to start in here end button.MouseButton1Down:connect(a)
I am not sure what exactly is wrong with the code, but I found a few problems that may be the source of the issue.
Line 47: function Open()end
There is not supposed to be an end there. Right now, the function "Open" has no code in it. Remove that end and place it near at the end of the function.
Line 91: Button.ClickDetector.MouseClick:connect(function() Open() end)
This is close, but not exactly right. When calling a function with a connect line, you only need to say the name of the function. No need to over complicate things! This is how it should be:
Button.ClickDetector.MouseClick:connect(Open)
Hopefully this helps! If you have any other issues, feel free to contact me by commenting or sending me a message on Roblox! Good luck, and happy coding!