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: Raider/Defender Timer

Previous Thread :: Next Thread 
voltar13 is not online. voltar13
Joined: 06 Jul 2011
Total Posts: 82
08 Nov 2012 07:51 PM
I have a raider/defender timer, do that if the "Defending" button is pressed, the timer counts up. If the "Raider" button is pressed, the timer counts down. It's for a base I've made. Though, I have a question. Is it possible to have the timer count up to a max amount of number then it stops? Ex. At the base, if no one presses the timer for like 20 minutes before a raider comes, the time the raider has to hold it for is already at 50. How do I have the timer count up to 30 minutes before stopping, as if to give raiders a fair chance? Here's the timer script:

while true do
wait(1)
if script.Owner.Value == "Raider" then
if script.Time.Seconds.Value > 0 then
m = script.Time.Minutes.Value
s = script.Time.Seconds.Value - 1
script.Parent.Name = ""..m..":"..s.." Remaining"
script.Time.Seconds.Value = s
script.Time.Minutes.Value = m
elseif script.Time.Seconds.Value <= 0 and script.Time.Minutes.Value > 0 then
m = script.Time.Minutes.Value - 1
script.Time.Seconds.Value = 59
s = script.Time.Seconds.Value
script.Parent.Name = ""..m..":"..s.." Remaining"
script.Time.Seconds.Value = s
script.Time.Minutes.Value = m
elseif script.Time.Seconds.Value <= 0 and script.Time.Minutes.Value == 0 then
if script.Raided.Value == false then
script.Parent.RaidedModel.RaidedGui:Clone().Parent = game.StarterGui
script.Raided.Value = true
script.Disabled = true
end
end
elseif script.Owner.Value == "Defense" then
if script.Time.Seconds.Value < 59 then
m = script.Time.Minutes.Value
s = script.Time.Seconds.Value + 1
script.Parent.Name = ""..m..":"..s.." Remaining"
script.Time.Seconds.Value = s
script.Time.Minutes.Value = m
else
m = script.Time.Minutes.Value + 1
script.Time.Seconds.Value = 0
s = script.Time.Seconds.Value
script.Parent.Name = ""..m..":"..s.." Remaining"
script.Time.Seconds.Value = s
script.Time.Minutes.Value = m
end
end
end


--V13--
Report Abuse
voltar13 is not online. voltar13
Joined: 06 Jul 2011
Total Posts: 82
08 Nov 2012 08:08 PM
Bump. Please help.
Report Abuse
voltar13 is not online. voltar13
Joined: 06 Jul 2011
Total Posts: 82
09 Nov 2012 05:43 PM
Bump..
Report Abuse
Solotaire is not online. Solotaire
Joined: 30 Jul 2009
Total Posts: 30356
09 Nov 2012 06:06 PM
Add an if statement that checks for the maximum time you are looking for.
Report Abuse
voltar13 is not online. voltar13
Joined: 06 Jul 2011
Total Posts: 82
09 Nov 2012 07:28 PM
Umm, how :/?
Report Abuse
voltar13 is not online. voltar13
Joined: 06 Jul 2011
Total Posts: 82
12 Nov 2012 09:47 AM
bump.
Report Abuse
voltar13 is not online. voltar13
Joined: 06 Jul 2011
Total Posts: 82
13 Nov 2012 08:57 PM
Bump..
Report Abuse
RareSLash is not online. RareSLash
Joined: 30 Dec 2010
Total Posts: 27
13 Nov 2012 08:59 PM
Bump, you must be awfully tired after bumping this thread instead of doing something useful. You're welcome.
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