Jump to content




[ Question ] [ Solved ] How to value = read() sleep(value)


  • You cannot reply to this topic
2 replies to this topic

#1 AnthonyD98™

  • Members
  • 193 posts
  • LocationAuckland, New Zealand

Posted 08 February 2013 - 09:51 AM

How would I have the user input a value and then the sleep function use that value?

write("Sleep Value > ")
value = read()
sleep(value)

Thats not going to work ^^

So how do I do it?

Thanks, AnthonyD98

#2 LBPHacker

  • Members
  • 766 posts
  • LocationBudapest, Hungary

Posted 08 February 2013 - 10:09 AM

read()
returns a string - and sleep() doesn't like strings. Solution:
sleep(tonumber(value))


#3 AnthonyD98™

  • Members
  • 193 posts
  • LocationAuckland, New Zealand

Posted 08 February 2013 - 10:13 AM

View PostLBPHacker, on 08 February 2013 - 10:09 AM, said:

read()
returns a string - and sleep() doesn't like strings. Solution:
sleep(tonumber(value))

Thank you that worked!

+1





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users