lua console question sorry, last question

  • flamethrower
    22nd Jun 2011 Member 0 Permalink
    lets say your'e making function setlife() then you want 2 lines of code, specifically:
    tpt.set_property("life", "9999", "dust") then you write:
    tpt.set_property("tmp", "9999", "dust") how do you put both of these codes into the function setlife()
  • ief015
    22nd Jun 2011 Former Staff 0 Permalink
    function setlife()
    tpt.set_property("life", "9999", "dust")
    tpt.set_property("tmp", "9999", "dust")
    end
    tpt.register_step(setlife)


    I recommend you look at the Lua wiki's sample code https://powdertoy.co.uk/Wiki.html?id=lua#simple_example_code to get a grasp of what a basic script looks like.
  • flamethrower
    22nd Jun 2011 Member 0 Permalink
    that doesn't work.
    when i write function glow() as a single line, it says the word 'end' is expected
  • limelier
    22nd Jun 2011 Member 0 Permalink
    I don't think glow is a function.
  • MasterMind555
    22nd Jun 2011 Member 0 Permalink
    @tudoreleuu (View Post)
    *facepalm*
    He's creating an function

    @flamethrower (View Post)
    You must write it all in one line then I think
  • limelier
    22nd Jun 2011 Member 0 Permalink

    tudoreleuu:

    I don't think glow is a function.
  • flamethrower
    22nd Jun 2011 Member 0 Permalink
    thank you so much! now i can clone green dust!!!
  • ief015
    22nd Jun 2011 Former Staff 0 Permalink
    Yes, you must write functions in a single line when using this console. But you are able to space them out multiline when you are running it from a script.
  • flamethrower
    22nd Jun 2011 Member 0 Permalink
    why not do the font? ( [+code] (writing) [+/code] ) no plus in the word code though
    Edited by flamethrower, 2011-06-22 03:44:57