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
 

Steady Clock

Previous Thread :: Next Thread 
gooey333 is not online. 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
VoidHackII is not online. VoidHackII
Joined: 02 Oct 2012
Total Posts: 2275
09 Sep 2014 12:27 PM
Buy one from walmart.
Report Abuse
gooey333 is not online. gooey333
Joined: 24 Mar 2013
Total Posts: 1208
09 Sep 2014 12:28 PM
Dude.
Report Abuse
Accomplishable is not online. Accomplishable
Joined: 13 Aug 2009
Total Posts: 6207
09 Sep 2014 12:29 PM
Not walmart. But a different store. A store that sells clocks. :]
Report Abuse
gooey333 is not online. gooey333
Joined: 24 Mar 2013
Total Posts: 1208
09 Sep 2014 12:29 PM
Quit it and answer the question.
Report Abuse
VoidHackII is not online. VoidHackII
Joined: 02 Oct 2012
Total Posts: 2275
09 Sep 2014 12:30 PM
He is right, though.
A good retailer is Howard Millers.
Report Abuse
gooey333 is not online. gooey333
Joined: 24 Mar 2013
Total Posts: 1208
09 Sep 2014 12:30 PM
Anyone else want to answer?
Report Abuse
Accomplishable is not online. Accomplishable
Joined: 13 Aug 2009
Total Posts: 6207
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 is not online. gooey333
Joined: 24 Mar 2013
Total Posts: 1208
09 Sep 2014 12:31 PM
Whats tick()
Report Abuse
VoidHackII is not online. VoidHackII
Joined: 02 Oct 2012
Total Posts: 2275
09 Sep 2014 12:32 PM
An insect that sucks blood.
Report Abuse
gooey333 is not online. 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 is not online. 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
VoidHackII is not online. VoidHackII
Joined: 02 Oct 2012
Total Posts: 2275
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 is not online. 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 is not online. 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 is not online. 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
Accomplishable is not online. Accomplishable
Joined: 13 Aug 2009
Total Posts: 6207
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 is not online. 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 is not online. 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
Accomplishable is not online. Accomplishable
Joined: 13 Aug 2009
Total Posts: 6207
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
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