Script Help

  • yellowcrash10
    26th Jun 2011 Member 0 Permalink
    Hello! I wrote a script for the Powder Toy that makes both stickmen invincible, (keeps their lives at 100) but when I try to run the script, it says "StickLife.lua:7: '< eof >' expected near 'end' "

    Here is what my script looks like:

    tpt.set_console(0)
    function StickLife()
    tpt.set_property("life",100,0,stkm)
    end

    tpt.set_property("life",100,388,stk2)
    end

    end

    tpt.register_step(StickLife)

    I don't know what's wrong! :(
    Edited by yellowcrash10, 2011-06-24 21:46:00
  • ief015
    26th Jun 2011 Former Staff 0 Permalink
    You have two extra "end"s. The only time when you need the keyword "end" is when you make a function, and the "end" tells when the function to stop (conditionals and loops also use it, too). "end" is not to be used after every line.
  • craZchick
    26th Jun 2011 Member 0 Permalink
    This post has been removed by ief015: No need for reply.
  • yellowcrash10
    26th Jun 2011 Member 0 Permalink
    I got it now. Thanks for the help! :)
    Edited by yellowcrash10, 2011-06-24 21:57:26
  • MasterMind555
    26th Jun 2011 Member 0 Permalink
    @yellowcrash10 (View Post)
    function functionname()

    All Script

    end
    Edited by MasterMind555, 2011-06-24 21:57:18
  • ief015
    26th Jun 2011 Former Staff 0 Permalink
    function StickLife()
    tpt.set_property("life",100,0,stkm)
    tpt.set_property("life",100,388,stk2)
    end

    tpt.register_step(StickLife)