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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Problem with waits?

Previous Thread :: Next Thread 
call23re is not online. call23re
Joined: 11 Nov 2010
Total Posts: 9070
28 Jan 2014 01:55 AM
In my game I have a countdown until something happens (Giant walls enter the serverstorage and back in to the workspace repeatedly after time.). In the game the walls enter the workspace way after the countdown hit's 0. I thought it might be because the countdown is a wait(1) and then change the time while the walls don't have a wait 1. This is probably hard to understand so I'll just show the scripts.

Countdown:
while true do
m = Instance.new("Hint",Workspace)
for i = 380, 1, -1 do
m.Text = i.. " seconds left to get ready"
wait(1) --it waits a second before going to the next number
end
for i = 380, 1, -1 do
m.Text = i.. " seconds left to fight"
wait(1) --it waits a second before going to the next number
end
for _, Player in pairs (Game.Players:GetPlayers()) do
pcall(function()
Player:LoadCharacter()
end)
end
end


Walls:
while true do
wait(395)--380] This made this part actually time correctly.
game.Workspace.walls.Parent = game.ServerStorage
wait(312)--380] Yet this part waits another 20 seconds after timer finishes.
game.ServerStorage.walls.Parent = Workspace
end


-"The wise never quote."
Report Abuse
call23re is not online. call23re
Joined: 11 Nov 2010
Total Posts: 9070
28 Jan 2014 03:33 AM
Sorry it's not a lot of information I'm on a slow laptop.


-"The wise never quote."
Report Abuse
call23re is not online. call23re
Joined: 11 Nov 2010
Total Posts: 9070
29 Jan 2014 01:22 AM
or maybe it's just a math problem



-"The wise never quote."
Report Abuse
Scriptural is not online. Scriptural
Joined: 06 Sep 2013
Total Posts: 2979
29 Jan 2014 01:49 AM
Because they get off sync, convert them into one script
Report Abuse
jd678 is not online. jd678
Joined: 18 Apr 2008
Total Posts: 11529
29 Jan 2014 02:44 AM
Yes please do what @Scriptural said, your way is so inefficient.
Report Abuse
call23re is not online. call23re
Joined: 11 Nov 2010
Total Posts: 9070
29 Jan 2014 07:42 PM
thanks,I fixed it


-"The wise never quote."
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