The combo game

Discussion in 'Forum Games' started by LivingAngryCheese, Sep 3, 2014.

  1. sgbros1

    sgbros1 New Member

  2. lenscas

    lenscas Over-Achiever

    while true do
    os.execute("pkill sgbors1")
    os.execute("pkill xTordX")
    end
     
  3. sgbros1

    sgbros1 New Member

  4. lenscas

    lenscas Over-Achiever

    while true do
    while true do
    os.execute("pkill sgbors1")
    os.execute("pkill xTordX")
    end
    end

    because the more loops the better :p
     
  5. sgbros1

    sgbros1 New Member

    nuuuuuuuuuu
     
  6. lenscas

    lenscas Over-Achiever

    function killPeople()
    local killList={"sgbros1","xTordX"}
    for key,value in pairs(killList) do
    os.execute("pkill "..value)
    end
    end

    while true do
    killPeople()
    end

    Now its even easier to maintain then before :p
     
  7. sgbros1

    sgbros1 New Member

  8. lenscas

    lenscas Over-Achiever

    killPeople()
     
  9. sgbros1

    sgbros1 New Member

    What if you ran it in the rp?
     
  10. lenscas

    lenscas Over-Achiever

    then it would not work as the function does not exist there:p
     
  11. sgbros1

    sgbros1 New Member

  12. lenscas

    lenscas Over-Achiever

    I can't help that it then gives a "input:1: attempt to call a nil value (global 'killPeople')"
     
  13. sgbros1

    sgbros1 New Member

  14. lenscas

    lenscas Over-Achiever

    that is a standard error message in lua like
    input:2: attempt to index a nil value (global 'lolz')
     
  15. sgbros1

    sgbros1 New Member

  16. lenscas

    lenscas Over-Achiever

    it however has a few less obvious problems if you are just learning to program.
    This code
    Code:
    if 1=2 then
    print("nope")
    end
    produces this error
    input:1: 'then' expected near '='
    for me the error is obvious but if you just start to learn how to write it.
     
  17. sgbros1

    sgbros1 New Member

    Erm...
    *walks away from code*
     
  18. Pyure

    Pyure Not Totally Useless

    This would be valid in some weird languages where the assignment and equality operator are the same :)
     
  19. sgbros1

    sgbros1 New Member

    *walks away from code*
     
  20. lenscas

    lenscas Over-Achiever

    For example small basic? That is one of the reasons I found that error confusing when I just started to learn how to write code. Thanks school btw >_>
     

Share This Page