The combo game

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

  1. lenscas

    lenscas Over-Achiever

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

    sgbros1 New Member

  3. 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
     
  4. sgbros1

    sgbros1 New Member

    nuuuuuuuuuu
     
  5. 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
     
  6. sgbros1

    sgbros1 New Member

  7. lenscas

    lenscas Over-Achiever

    killPeople()
     
  8. sgbros1

    sgbros1 New Member

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

    lenscas Over-Achiever

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

    sgbros1 New Member

  11. lenscas

    lenscas Over-Achiever

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

    sgbros1 New Member

  13. lenscas

    lenscas Over-Achiever

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

    sgbros1 New Member

  15. 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.
     
  16. sgbros1

    sgbros1 New Member

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

    Pyure Not Totally Useless

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

    sgbros1 New Member

    *walks away from code*
     
  19. 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 >_>
     
  20. sgbros1

    sgbros1 New Member

    *slowly backs away from code talk*
     

Share This Page