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 » Scripters
Home Search
 

Re: How may I fix this countdown?

Previous Thread :: Next Thread 
NakedManHaHaHaHa is not online. NakedManHaHaHaHa
Joined: 11 Nov 2014
Total Posts: 26
19 Jan 2017 11:42 AM
This is in a script, in a StarterGUI + A text label.

while true do
script.Parent.Text = "3 Hours Remaining"
wait(60)

script.Parent.Text = "2 Hours Remaining"
wait(60)

script.Parent.Text = "1 Hour Remaining"
wait(60)

script.Parent.Text = "Survival Ended"
wait(5)

script.Parent.Text = "Intermission."
wait(1)

script.Parent.Text = "Intermission.."
wait(1)

script.Parent.Text = "Intermission..."
wait(1)

script.Parent.Text = "Intermission."
wait(1)

script.Parent.Text = "Intermission.."
wait(1)

script.Parent.Text = "Intermission..."
wait(1)

script.Parent.Text = "Get ready to survive"
wait(3)
end


R$18
Report Abuse
Snowskateer is not online. Snowskateer
Joined: 06 Dec 2011
Total Posts: 4647
19 Jan 2017 01:03 PM
function GameState()
local hours = 3
repeat
script.Parent.Text = hours.." Hours Remaining"
hours = hours - 1
until hours = 0
script.Parent.Text = "Survival Ended"
wait(5)
end

function Intermission()
time = 7
dots = 0
repeat
if dots = 4 then
dots = 0
end
if dots = 1 then
script.Parent.Text = "Intermission."
elseif dots = 2 then
script.Parent.Text = "Intermission.."
elseif dots = 3 then
script.Parent.Text = "Intermission..."
end
dots = dots+1
time = time-1
until time = 0
script.Parent.Text = "Get ready to survive"
wait(3)
end

while wait() do
Intermission()
GameState()
end

NOW GATHER, UNDER THE NAME OF TEAM ROCKET!
Report Abuse
Snowskateer is not online. Snowskateer
Joined: 06 Dec 2011
Total Posts: 4647
19 Jan 2017 01:05 PM
my bad, messed up

function GameState()
local hours = 3
repeat script.Parent.Text = hours.." Hours Remaining"
hours = hours - 1
wait(60)
until hours = 0
script.Parent.Text = "Survival Ended"
wait(5)
end

function Intermission()
time = 7
dots = 0
repeat wait(1)
if dots = 4 then
dots = 0
end
if dots = 1 then
script.Parent.Text = "Intermission."
elseif dots = 2 then
script.Parent.Text = "Intermission.."
elseif dots = 3 then
script.Parent.Text = "Intermission..."
end
dots = dots+1
time = time-1
until time = 0
script.Parent.Text = "Get ready to survive"
wait(3)
end

while wait() do
Intermission()
GameState()
end

NOW GATHER, UNDER THE NAME OF TEAM ROCKET!
Report Abuse
Roblok1 is online. Roblok1
Joined: 27 Jul 2011
Total Posts: 2019
19 Jan 2017 01:20 PM
Well, first of all, you might want to do the countdown part in a seperate script in ServerScriptService.
Then insert a StringValue in ReplicatedStorage and change that value instead.
Next, insert a LocalScript inside of the gui text label.
After that, in the local script, change the text of the text label to what the string value is whenever its changed.

And there you have it. I will post the script(s) in a min...


Report Abuse
pidgey is not online. pidgey
Joined: 16 Jan 2008
Total Posts: 2739
19 Jan 2017 01:48 PM
for seconds = 1, 60 do
print("Intermission."..string.rep(".", seconds % 3)) --adds 2 dots max, changes every time seconds increments

wait(1)
end

this is a lot easier than using a bunch of if statements i guess

http://wiki.roblox.com/index.php?title=Global_namespace/String_manipulation#string.rep
Report Abuse
Roblok1 is online. Roblok1
Joined: 27 Jul 2011
Total Posts: 2019
19 Jan 2017 02:16 PM
Ok, here are the scripts... Sorry for the late reply

-- Server Script in ServerScriptService ---------------------------
msg = game.ReplicatedStorage.gameText -- make sure its a string value
while true do
for i = 3, 1, - 1 do
if i == 1 then
msg.Value = i.." Hour Remaining"
else
msg.Value = i.." Hours Remaining"
end
wait(60)
end

msg.Value = "Survival Ended"
wait(5)

for i = 10, 0, - 1 do
msg.Value = "Intermission."
wait(1)
end

msg.Value = "Get ready to survive"
wait(3)
end

-- Local Script in a TextLabel -------------------------------
msg = game.ReplicatedStorage.gameText -- make sure its a string value
label = script.Parent

msg.Changed:connect(function() label.Text = msg.Value end)


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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