Lua Help Thread

  • biostars
    4th Jan 2012 Member 0 Permalink

    THANKS A LOT! Could you just show me how to do movable solids!?

  • kerbal1234
    12th May 2012 Member 0 Permalink
    can somebody who is experienced in lua (like Me4502) please PM me? i am having a lot of trouble with my lua mod.
  • mniip
    12th May 2012 Developer 0 Permalink
    you mean like mniip, dont you?
  • kerbal1234
    12th May 2012 Member 0 Permalink
    @mniip (View Post)
    yup. i guess i should have said i want help from kings of epicness. (you.)
  • shutterbug
    9th Jun 2012 Member 0 Permalink

    Alright I'm extremely new to this, so my first question is as follows:

     

    1: How might I write multi-line script and run it? Can this be done in-game? Can this be done outside of the game?

  • Simon
    9th Jun 2012 Administrator 0 Permalink
    @shutterbug (View Post)
    You can use
    dofile("file.txt")
    to execute scripts that are saved to your hard drive.
  • shutterbug
    9th Jun 2012 Member 0 Permalink

    @Simon (View Post)

    1:So... I write a .txt file with the lua script in it? I don't have to use notepad++ or anything?

     

    2:Can multiple 'and' statements be in one line?

     

    (ex. : if mousex > 180 and mousex < 187 and mousey > 120)

  • jacob1
    9th Jun 2012 Developer 0 Permalink
    @shutterbug (View Post)
    1. Yes, I just use notepad but you can use any text editor really. Multiple and statements work too.
  • DJspiderize
    9th Jun 2012 Member 0 Permalink

    Quick question, how do you make something non-flammable? I know it's probably obvious. A one line command, but I'm new to this :/

  • shutterbug
    9th Jun 2012 Member 0 Permalink

    @jacob1 (View Post)

    Great! thanks :)

     

    3: I'm having trouble with a script of mine :/

    tpt.register_step (
    "if mousex>188 and mousex<124 and mousey<121 and mousey>109 then
    (tpt.drawtext (188, 109, "testing")
    end")

    It's giving me and error saying "unfinished string"