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
 

Re: No output?

Previous Thread :: Next Thread 
flatline115 is not online. flatline115
Joined: 29 Jul 2013
Total Posts: 7826
18 Sep 2013 03:39 PM
function wait(n)
local now = os.time()
while os.time() - now < n do end
print("achievement unlocked")
end
wait(1)
Report Abuse
keehl257 is not online. keehl257
Joined: 12 May 2013
Total Posts: 122
18 Sep 2013 03:39 PM
:/ wait is a roblox API...
Report Abuse
flatline115 is not online. flatline115
Joined: 29 Jul 2013
Total Posts: 7826
18 Sep 2013 03:40 PM
Who said this was for roblox?
Report Abuse
funnymouse7 is not online. funnymouse7
Joined: 17 Mar 2011
Total Posts: 1741
18 Sep 2013 03:41 PM
Youre missing an end
And better put a wait () in the while loop
Report Abuse
keehl257 is not online. keehl257
Joined: 12 May 2013
Total Posts: 122
18 Sep 2013 03:42 PM
good point..Just figured since it is on roblox forums... What is it for :3 I know roblox through to comptuercraft lua..To just plain.
Report Abuse
flatline115 is not online. flatline115
Joined: 29 Jul 2013
Total Posts: 7826
18 Sep 2013 03:42 PM
Youre missing an end
And better put a wait () in the while loop
-----------
Lies.
Report Abuse
keehl257 is not online. keehl257
Joined: 12 May 2013
Total Posts: 122
18 Sep 2013 03:43 PM
Hmm..Either im losing myself, or i don't see where he is missing the end
Report Abuse
funnymouse7 is not online. funnymouse7
Joined: 17 Mar 2011
Total Posts: 1741
18 Sep 2013 03:44 PM
Nvm my post
Report Abuse
keehl257 is not online. keehl257
Joined: 12 May 2013
Total Posts: 122
18 Sep 2013 03:44 PM
i think in other forms of lua..Its sleep(n)

so you could just do something like
sleep(1)
print("Achievment unlocked")

Report Abuse
flatline115 is not online. flatline115
Joined: 29 Jul 2013
Total Posts: 7826
18 Sep 2013 03:44 PM
What is it for
---------
A game I am working on outside of roblox.
I am so used to doing wait via roblox lua that I decided to make a function for it.
Report Abuse
keehl257 is not online. keehl257
Joined: 12 May 2013
Total Posts: 122
18 Sep 2013 03:44 PM
seeing how your using os, im guessing its for computer craft..Have you tried the computer craft help forums yet?
Report Abuse
flatline115 is not online. flatline115
Joined: 29 Jul 2013
Total Posts: 7826
18 Sep 2013 03:45 PM
i think in other forms of lua..Its sleep(n)
-----------
No.
load.lua:8: attempt to call global 'sleep' (a nil value)
Report Abuse
keehl257 is not online. keehl257
Joined: 12 May 2013
Total Posts: 122
18 Sep 2013 03:46 PM
Is it an already made game..Or are you litterly making a game out of lua?
Report Abuse
flatline115 is not online. flatline115
Joined: 29 Jul 2013
Total Posts: 7826
18 Sep 2013 03:46 PM
seeing how your using os, im guessing its for computer craft..Have you tried the computer craft help forums yet?
-----------
I do not even use computer craft. I also do not know what it is.
Report Abuse
flatline115 is not online. flatline115
Joined: 29 Jul 2013
Total Posts: 7826
18 Sep 2013 03:48 PM
Is it an already made game..Or are you litterly making a game out of lua?
--
I am using lua for my games' logic.
Report Abuse
keehl257 is not online. keehl257
Joined: 12 May 2013
Total Posts: 122
18 Sep 2013 03:49 PM
i think:

function wait(n)
local t = os.clock
while os.clock - t <= n do end
print("achievement unlocked")
end
Report Abuse
keehl257 is not online. keehl257
Joined: 12 May 2013
Total Posts: 122
18 Sep 2013 03:49 PM
sorry nvm that post :/
Report Abuse
tyele is not online. tyele
Joined: 03 Nov 2008
Total Posts: 320
18 Sep 2013 03:49 PM
Don't post it on Roblox if it's not for Roblox. This is for Lua, not anything else.
Report Abuse
keehl257 is not online. keehl257
Joined: 12 May 2013
Total Posts: 122
18 Sep 2013 03:50 PM
this is lua :/
Report Abuse
keehl257 is not online. keehl257
Joined: 12 May 2013
Total Posts: 122
18 Sep 2013 03:51 PM
well...

local clock = os.clock
function wait(n)
local t = clock()
while clock() - t <= n do end
print("achievement unlocked")
end
Report Abuse
flatline115 is not online. flatline115
Joined: 29 Jul 2013
Total Posts: 7826
18 Sep 2013 03:51 PM
Don't post it on Roblox if it's not for Roblox. This is for Lua, not anything else.
---------
Please, tell me what scripting language roblox runs on?
Report Abuse
flatline115 is not online. flatline115
Joined: 29 Jul 2013
Total Posts: 7826
18 Sep 2013 03:52 PM
local clock = os.clock
function wait(n)
local t = clock()
while clock() - t <= n do end
print("achievement unlocked")
end
------------
That wouldn't work. You need to get the time as it stands therefore subtracting an older time value will just result in negatives indefinitely.
Report Abuse
keehl257 is not online. keehl257
Joined: 12 May 2013
Total Posts: 122
18 Sep 2013 03:57 PM
hmm...

i kinda given up trying to help now so im just searching..
Something said Implement LuaSocket library and try this

socket.sleep(time)
Report Abuse
flatline115 is not online. flatline115
Joined: 29 Jul 2013
Total Posts: 7826
18 Sep 2013 04:00 PM
You do not understand my problem the code is perfect. The problem is that it goes over by .27 or under by .27. I want it to finish at exactly 1.
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