Jump to content




My comp code error


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

#1 bloodstabber

  • New Members
  • 2 posts

Posted 06 August 2012 - 04:29 AM

Print "welcome to bloodstabbers pc please enter username"
Input = read()
If input == "bloodstabber" then
Print "welcome bloodstabber"
Sleep(3)
Print "please enter your password
Input = read("*")
If input == "SourCow" then
Sleep(2)
Print "welcome to your computer, bloodstabber!"
Else
Print "you are not the owner of this pc! Please leave!"
Sleep(5)
Os.reboot
End

I tried my best but it keeps giving me stupid errors like it needs = at end or it wants = at end of line 3 please help it would sure help me :P/>

#2 Zalerinian

  • New Members
  • 68 posts
  • LocationThe Internet

Posted 06 August 2012 - 05:10 AM

View Postbloodstabber, on 06 August 2012 - 04:29 AM, said:

Print "welcome to bloodstabbers pc please enter username"
Input = read()
If input == "bloodstabber" then
Print "welcome bloodstabber"
Sleep(3)
Print "please enter your password
Input = read("*")
If input == "SourCow" then
Sleep(2)
Print "welcome to your computer, bloodstabber!"
Else
Print "you are not the owner of this pc! Please leave!"
Sleep(5)
Os.reboot
End

I tried my best but it keeps giving me stupid errors like it needs = at end or it wants = at end of line 3 please help it would sure help me :P/>

Can you specify what the error is? or is it saying you do need a '=' at line 3?

#3 kotorone1

  • New Members
  • 20 posts

Posted 06 August 2012 - 05:12 AM

hello, here is a script that should work.
Spoiler


#4 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 06 August 2012 - 05:52 AM

View Postbloodstabber, on 06 August 2012 - 04:29 AM, said:

Print "welcome to bloodstabbers pc please enter username"
Input = read()
If input == "bloodstabber" then
Print "welcome bloodstabber"
Sleep(3)
Print "please enter your password
Input = read("*")
If input == "SourCow" then
Sleep(2)
Print "welcome to your computer, bloodstabber!"
Else
Print "you are not the owner of this pc! Please leave!"
Sleep(5)
Os.reboot
End

I tried my best but it keeps giving me stupid errors like it needs = at end or it wants = at end of line 3 please help it would sure help me :P/>

Lua is an interpreted computer language, not English. It's case sensitive, so when you capitalize the first letter of the line, you're changing what it does. "If" and "if" are completely different.

#5 KevinW1998

  • Members
  • 93 posts
  • LocationAustria(German)

Posted 06 August 2012 - 05:53 AM

You should add OS.pullEvent = OS.pullEventRaw to make it termination-safe

#6 bloodstabber

  • New Members
  • 2 posts

Posted 06 August 2012 - 06:40 AM

Well guys i figured it out WAY before you responded i figured i need to ends so i can have multiple cases
Thanks anyway





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users