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: I messed up here.

Previous Thread :: Next Thread 
LordFedoraS5 is not online. LordFedoraS5
Joined: 30 Apr 2012
Total Posts: 1300
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
lampwnage121 is not online. lampwnage121
Joined: 20 Oct 2012
Total Posts: 4285
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
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