cokePanda
|
  |
| Joined: 30 Dec 2008 |
| Total Posts: 1901 |
|
|
| 07 Apr 2015 03:11 PM |
local P = script.Parent while true do wait(1) P.Value = P.Parent.Time.Value -1
end
P.Parent.Time.Value is set to something every few seconds, I want this script to check what it is, and then count down from it to 0 and then stop, and wait for P.Parent.time.Value to be set to something again and then count down, any one get what I'm trying to achieve and could help me out with sorting a code for this? I'd really appreciate it.
|
|
|
| Report Abuse |
|
|
Klink45
|
  |
| Joined: 06 Jun 2011 |
| Total Posts: 26054 |
|
|
| 07 Apr 2015 03:13 PM |
Sorry if I misunderstood you, but you could try something like this:
function CountDown(int) for i = int,0, -1 do script.Parent.TextLabel.Text = i; wait(1) end end |
|
|
| Report Abuse |
|
|
cokePanda
|
  |
| Joined: 30 Dec 2008 |
| Total Posts: 1901 |
|
| |
|
cokePanda
|
  |
| Joined: 30 Dec 2008 |
| Total Posts: 1901 |
|
| |
|
|
| 07 Apr 2015 03:35 PM |
| Get out you stupid #### go ask for help in the ##### #### |
|
|
| Report Abuse |
|
|
|
| 07 Apr 2015 03:36 PM |
function Intermission() for i = IntermissionTime, 0, -1 do print("Intermission: " .. i .. "") end end end |
|
|
| Report Abuse |
|
|
|
| 07 Apr 2015 03:37 PM |
| local IntermissionTime = 30 |
|
|
| Report Abuse |
|
|
amanda
|
  |
| Joined: 21 Nov 2006 |
| Total Posts: 5925 |
|
|
| 07 Apr 2015 03:38 PM |
local P = script.Parent while true do wait(1) if P.Value > 0 then P.Value = P.Parent.Time.Value -1 end end |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 07 Apr 2015 03:40 PM |
local t = script.Parent.Time while wait() do wait(1) t.Value = t.Value - 1
if t.Value == 0 then print("Time is 0") for i = 20,1,-1 t.Value == i --new Value is 20 end end end
Is this what you are trying to achieve? If not can you clarify again? |
|
|
| Report Abuse |
|
|
cokePanda
|
  |
| Joined: 30 Dec 2008 |
| Total Posts: 1901 |
|
|
| 07 Apr 2015 04:10 PM |
Screen Gui> - Holds all below in it.
1. TextButton>Script - Script changes Value in TextButton named "Time" (NumberValue). - works 2. Time(NumberValue) - Used by above for wait(Time) 3. Count(NumberValue)>Script - Script changes Value of Count to Value of Time and Counts it down by doing -1 every 1 second (wait(1)) - doesn't work 4. Countdown(TextLabel) - Text of it should show Count(NumberValue), a countdown - doesn't work.
Script for 3.Count (not working):
local IntermissionTime = script.Parent.Parent.Time
function Intermission() for i = IntermissionTime.Value, 0, -1 do script.Parent.Value = i end end
Script for 4.Countdown (not working):
while true do wait(0.4) if script.Parent.Parent.Parent.Visible == true then local sec = script.Parent.Parent.Parent.Parent.TextButton.Count script.Parent.Text = ""..sec.Value.."s"
else print'no' end end
Is there anyone who could help me with this? I can provide you with a model for this, so it's a lot easier to fix... I would really appreciate your time. |
|
|
| Report Abuse |
|
|