|
| 28 Aug 2014 07:14 PM |
There are around 100 of these doors that are suppose to close after the countdown. Before I added the countdown and the messages and sound, all worked fine and they all shut at the same time. Now, the countdown happens, and one door shuts, the countdown happens again, and another shuts, and so on.
I'd appreciate help because I know if I'd have a go at fixing the problem, I'd mess up, no matter how simple it is...
--
script.Parent.ClickDetector.MouseClick:connect(function() for _,v in pairs(game.Workspace.Lockdown.Model:GetChildren()) do script.Parent.Parent.Sound:Play() M = Instance.new("Message") M.Parent = game.Workspace M.Text = "Head Quarters Lockdown Activated. Starting in 10 seconds." wait(8) M.Text = " " wait(1) M.Text = "10" wait(1) M.Text = " " wait(1) M.Text = "9" wait(1) M.Text = " " wait(1) M.Text = "8" wait(1) M.Text = " " wait(1) M.Text = "7" wait(1) M.Text = " " wait(1) M.Text = "6" wait(1) M.Text = " " wait(1) M.Text = "5" wait(1) M.Text = " " wait(1) M.Text = "4" wait(1) M.Text = " " wait(1) M.Text = "3" wait(1) M.Text = " " wait(1) M.Text = "2" wait(1) M.Text = " " wait(1) M.Text = "1" wait(1) M.Text = " " wait(1) M.Text = "0" wait(1) M.Text = "Locking all doors and windows..." wait(3) v.blind1.Transparency = 0 v.blind2.Transparency = 0 v.Transparency = 0 v.CanCollide = true wait(3) M.Text = "Head Quarters Lockdown Succesful." wait(8) M:remove() end end)
--
Thanks, -LF |
|
|
| Report Abuse |
|
|
| 28 Aug 2014 07:24 PM |
.-. It's repeating because you put it inside of a loop that will run once for every object it finds. Simply put the timer before the loop if you want it to run once. Also, Use a generic for loop to make the countdown next time.
M.Text = "Head Quarters Lockdown Activated. Starting in 10 seconds." wait(8) M.Text = " " wait(1) for i = 10,0,-1 do M.Text = i wait(1) M.Text = "" wait(1) end M.Text = "Locking all doors and windows..." wait(3) |
|
|
| Report Abuse |
|