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
|
  |
| Joined: 06 Jul 2011 |
| Total Posts: 82 |
|
| |
|
voltar13
|
  |
| Joined: 06 Jul 2011 |
| Total Posts: 82 |
|
| |
|
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
|
  |
| Joined: 06 Jul 2011 |
| Total Posts: 82 |
|
| |
|
voltar13
|
  |
| Joined: 06 Jul 2011 |
| Total Posts: 82 |
|
| |
|
voltar13
|
  |
| Joined: 06 Jul 2011 |
| Total Posts: 82 |
|
| |
|
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 |
|
|