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 » Scripters
Home Search
 

Re: A challenge for you..

Previous Thread :: Next Thread 
LockFocus is not online. LockFocus
Joined: 31 Aug 2013
Total Posts: 1044
08 Aug 2016 08:38 AM
..wait for exactly 1 second.
Report Abuse
Alimegacorn is not online. Alimegacorn
Joined: 24 May 2013
Total Posts: 899
08 Aug 2016 08:40 AM
i like cheeseburgers

:)
Report Abuse
Flux_Capacitor is not online. Flux_Capacitor
Joined: 07 Apr 2008
Total Posts: 45720
08 Aug 2016 08:42 AM
impossible, even in real life :)
Report Abuse
Wowgnomes is not online. Wowgnomes
Joined: 27 Sep 2009
Total Posts: 26255
08 Aug 2016 09:39 AM
what is a second
Report Abuse
pketny is not online. pketny
Joined: 27 Dec 2010
Total Posts: 1162
08 Aug 2016 09:45 AM
local t = tick()

repeat
until nil

print(tick() - t)

> 1.0000000000000

run in-game in a local script, it works!
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
08 Aug 2016 09:49 AM
I have several methods.

local Start = os.time()
repeat wait() until os.time()-Start == 1
-- Guaranteed to wait exactly 1 second, according to os.time.

local T = tick()
local Start = T()
repeat until T()-Start>=1
-- Not exactly 1 second, but closer than most other things.


Report Abuse
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
08 Aug 2016 09:54 AM
the only current way to wait about 1 second exactly is this

function wait2(t)
local t_ = tick()
while game:getService("RunService").RenderStepped:wait() do
if tick()-t_ > (t or 0) then
break
end
end
return t_
end


will work like wait

wait()
wait2()

wait(1)
wait2(1)

and will return time passed

mine will be slightly more accurate since it checks every frame which at 60 fps is 1/60 of a second rather than 0.029999
Report Abuse
AggressiveCatch is not online. AggressiveCatch
Joined: 17 Jul 2011
Total Posts: 5840
08 Aug 2016 09:55 AM
"local Start = os.time()
repeat wait() until os.time()-Start == 1"

but OS time doesn't even have decimals...
Report Abuse
pketny is not online. pketny
Joined: 27 Dec 2010
Total Posts: 1162
08 Aug 2016 09:56 AM
@JarodOfOrbiter
> local t = tick()


local Start = os.time()
repeat wait() until os.time()-Start == 1


local p = tick() - t

print(p)
0.13239026069641



lolwut are you doing mate?
Report Abuse
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
08 Aug 2016 09:57 AM
^ Yea that's why you use tick()

also mine should be the closest you can get using local scripts i believe
Report Abuse
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
08 Aug 2016 09:58 AM
oops
return tick()-t_,t_


this will return the time passed,game time
Report Abuse
Flux_Capacitor is not online. Flux_Capacitor
Joined: 07 Apr 2008
Total Posts: 45720
08 Aug 2016 10:02 AM
lmao you guys didn't get the joke
ffs dumb`11
Report Abuse
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
08 Aug 2016 10:02 AM
k but yay it works kinda

1.0071811676025
Report Abuse
pketny is not online. pketny
Joined: 27 Dec 2010
Total Posts: 1162
08 Aug 2016 10:04 AM
Everyone got the joke... They are trying to find the closest way tho
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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