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 » Roblox » Help (Technical Support and Account Issues)
Home Search
 

Scripting Help ( Also I reached my 100th post )

Previous Thread :: Next Thread 
ThatAwsom3GuyHD is not online. ThatAwsom3GuyHD
Joined: 23 Oct 2013
Total Posts: 456
20 Jan 2015 09:42 PM
So my script goes like this :
game.StarterGui.ScreenGui.TextLabel.Text = "Minigame / Obby / Survival will start in : 30 secs"
wait(1)

With 30 Seconds counting down. But It does work and that means I wasted 5 minutes of copy paste, how do I make it count down, and yet not make it 60 lines?
Report Abuse
ScoutingBear is not online. ScoutingBear
Joined: 22 Oct 2009
Total Posts: 1769
20 Jan 2015 10:05 PM
Put this script in the text label


label = script.Parent

count = 30 --//Countdown
print("hey")
while wait(1) do
label.Text = "Minigame / Obby / Survival will start in : " .. count .. " seconds"
count = count - 1
if count == 0 then
break --move onto next task
end
end

print("Countdown over")
Report Abuse
ThatAwsom3GuyHD is not online. ThatAwsom3GuyHD
Joined: 23 Oct 2013
Total Posts: 456
20 Jan 2015 10:08 PM
I was also thinking of making it wait 30 secs, then repeat because its like the "Survive the disasters"
Report Abuse
ScoutingBear is not online. ScoutingBear
Joined: 22 Oct 2009
Total Posts: 1769
20 Jan 2015 10:13 PM
You'll probably need to make some sort of BoolValue in the Workspace so the script knows when to countdown, because other players will not be synced with this counter.


If you want it to repeat a counter then you could try the following, but it may not work as hoped since I'm currently not in Studio anymore.

label = script.Parent
count = 30 --//Countdown

function countdown()
while wait(1) do
label.Text = "Minigame / Obby / Survival will start in : " .. count .. " seconds"
count = count - 1
if count == 0 then
break --move onto next task
end
end
end


while wait(30) do
countdown()
end
Report Abuse
ThatAwsom3GuyHD is not online. ThatAwsom3GuyHD
Joined: 23 Oct 2013
Total Posts: 456
20 Jan 2015 10:18 PM
When I did BOTH of em ( 1 at a time )
They all said "21:16:42.942 - Text is not a valid member of PlayerGui"
Report Abuse
ScoutingBear is not online. ScoutingBear
Joined: 22 Oct 2009
Total Posts: 1769
20 Jan 2015 10:19 PM
Have you possibly put the script inside the PlayerGui instead of the TextLabel?
Report Abuse
ThatAwsom3GuyHD is not online. ThatAwsom3GuyHD
Joined: 23 Oct 2013
Total Posts: 456
20 Jan 2015 10:20 PM
Yea, did I mess up?
Report Abuse
ScoutingBear is not online. ScoutingBear
Joined: 22 Oct 2009
Total Posts: 1769
20 Jan 2015 10:23 PM
Well the script is designed to be inside the TextLabel to work, were you looking for it to be outside the TextLabel?
Report Abuse
ThatAwsom3GuyHD is not online. ThatAwsom3GuyHD
Joined: 23 Oct 2013
Total Posts: 456
20 Jan 2015 10:24 PM
I'll just move it
Report Abuse
ThatAwsom3GuyHD is not online. ThatAwsom3GuyHD
Joined: 23 Oct 2013
Total Posts: 456
20 Jan 2015 10:25 PM
Yay it worked now for the repeat
Report Abuse
ScoutingBear is not online. ScoutingBear
Joined: 22 Oct 2009
Total Posts: 1769
20 Jan 2015 10:27 PM
Fixed an error, forgot to make the timer reset to it's original value.

label = script.Parent
count = 30 --//Countdown

function countdown()
local re_record = count
while wait(1) do
label.Text = "Minigame / Obby / Survival will start in : " .. count .. " seconds"
count = count - 1
if count == 0 then
count = re_record
break --move onto next task
end
end
end


while wait(30) do
countdown()
end
Report Abuse
ThatAwsom3GuyHD is not online. ThatAwsom3GuyHD
Joined: 23 Oct 2013
Total Posts: 456
20 Jan 2015 10:51 PM
Now it's just not working of of the sudden, I have it in TextLabel
Report Abuse
ThatAwsom3GuyHD is not online. ThatAwsom3GuyHD
Joined: 23 Oct 2013
Total Posts: 456
20 Jan 2015 11:10 PM
The repeat doesn't start the count down, yet no errors too
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Roblox » Help (Technical Support and Account Issues)
   
 
   
  • 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