gooey333
|
  |
| Joined: 24 Mar 2013 |
| Total Posts: 1208 |
|
|
| 09 Sep 2014 12:27 PM |
I have a clock that executes some code every go-around.
while true do
wait(.03)
--Code Here
end
Every time I play the game (in studio) it goes at a different speed. Sometimes the right speed and sometimes it goes super speed. I haven't tried this in roblox player yet but it does it in roblox studio. I'm not sure it matters though. Please tell me how to make the clock execute the code the same speed every time. Or how to make a new clock. |
|
|
| Report Abuse |
|
|
| |
|
gooey333
|
  |
| Joined: 24 Mar 2013 |
| Total Posts: 1208 |
|
| |
|
|
| 09 Sep 2014 12:29 PM |
| Not walmart. But a different store. A store that sells clocks. :] |
|
|
| Report Abuse |
|
|
gooey333
|
  |
| Joined: 24 Mar 2013 |
| Total Posts: 1208 |
|
|
| 09 Sep 2014 12:29 PM |
| Quit it and answer the question. |
|
|
| Report Abuse |
|
|
|
| 09 Sep 2014 12:30 PM |
He is right, though. A good retailer is Howard Millers. |
|
|
| Report Abuse |
|
|
gooey333
|
  |
| Joined: 24 Mar 2013 |
| Total Posts: 1208 |
|
|
| 09 Sep 2014 12:30 PM |
| Anyone else want to answer? |
|
|
| Report Abuse |
|
|
|
| 09 Sep 2014 12:31 PM |
| Tbh I don't know how you're getting this issue if you're not using tick() |
|
|
| Report Abuse |
|
|
gooey333
|
  |
| Joined: 24 Mar 2013 |
| Total Posts: 1208 |
|
| |
|
|
| 09 Sep 2014 12:32 PM |
| An insect that sucks blood. |
|
|
| Report Abuse |
|
|
gooey333
|
  |
| Joined: 24 Mar 2013 |
| Total Posts: 1208 |
|
|
| 09 Sep 2014 12:33 PM |
| Oh. Can you tell me how to put it in my script? |
|
|
| Report Abuse |
|
|
gooey333
|
  |
| Joined: 24 Mar 2013 |
| Total Posts: 1208 |
|
|
| 09 Sep 2014 12:34 PM |
| Actually I don't like bugs in my script plz don't. |
|
|
| Report Abuse |
|
|
|
| 09 Sep 2014 12:34 PM |
| Go look for one on the ground or under a dogs ear ( good place ), then put it on ur computer. |
|
|
| Report Abuse |
|
|
gooey333
|
  |
| Joined: 24 Mar 2013 |
| Total Posts: 1208 |
|
|
| 09 Sep 2014 12:37 PM |
| I don't think that's gonna fix my issue. |
|
|
| Report Abuse |
|
|
Roblok1
|
  |
| Joined: 27 Jul 2011 |
| Total Posts: 2019 |
|
|
| 09 Sep 2014 12:47 PM |
ok,if these noobs won't help, then i will.
you don't use a while loop to make a clock. instead use a for loop inside of a while loop. here is what i would do:
while true do
local seconds = 59 local minutes = (how ever many you want)
for i = 1, minutes do for i = 1, seconds + 1 do
-- put your code here
wait(1) -- there absolutely needs to be a wait
seconds = seconds - 1 end
minutes = minutes - 1 end
end
here is how it works, i put a double for loop in s while loop. the outer for loop is for the minutes and the inner for loop is for the seconds. and the while loop is to make it keep going. you dont need to add the while. |
|
|
| Report Abuse |
|
|
SLY3
|
  |
| Joined: 10 Jul 2008 |
| Total Posts: 1700 |
|
|
| 09 Sep 2014 01:02 PM |
| come to my big white van we give out free clocks that go really smooth ok |
|
|
| Report Abuse |
|
|
|
| 09 Sep 2014 01:09 PM |
I made a better clock.
This one's simple and recommended (by me)
local minutes, seconds = 0,10; for m = 1, minutes + 1 do for e = 1, seconds + 1 do if seconds < 10 then roundText("Time", "Time left: "..minutes..":0"..seconds); else roundText("Time", "Time left: "..minutes..":"..seconds); end seconds = seconds - 1; wait(1); end seconds = 59; minutes = minutes - 1; end |
|
|
| Report Abuse |
|
|
Roblok1
|
  |
| Joined: 27 Jul 2011 |
| Total Posts: 2019 |
|
|
| 09 Sep 2014 01:11 PM |
| oh yeah oops. i guess i must have forgotten some code huh. my bad. |
|
|
| Report Abuse |
|
|
gooey333
|
  |
| Joined: 24 Mar 2013 |
| Total Posts: 1208 |
|
|
| 09 Sep 2014 01:18 PM |
| Did you guys even read what I said? I don't want a stopwatch I want a steady superspeed clock. I simply said wait(.03) and it waits .03 seconds each time and executes code. But sometimes it goes like (.01 - .04). I want .03 steadily. |
|
|
| Report Abuse |
|
|
|
| 09 Sep 2014 01:22 PM |
time for a quick lecture
when you create a decimal variable in a script (i.e. 0.3, 0.003, 0.03), it ends up like this: 0.03333337333344338
If this isn't true, then feel free to prove me wrong. But I'm assuming this is the issue.
wait(math.floor(0.03 * 100)/100); |
|
|
| Report Abuse |
|
|