How do you make a custom element?

  • billion57
    24th Apr 2012 Member 0 Permalink
    I mean how do you make the autorun.lua file?
    EDIT: Never mind, I've got it.
  • boxmein
    24th Apr 2012 Former Staff 0 Permalink
    Now this here is a prime example for a bad help thread.
    For everyone's sake, post the solution!
    Lua function "tpt.element_func"
    tpt.element_func
    allows you to replace or add on to an element's update function. Write a function like normal, and then put its name into this command. Use tpt.element("...") or tpt.el.dust.id for el_number, and make replace true if you want to overwrite the previous function, or false instead.
    Passes: (number index, number partx, number party, number surround_space, number nt)
    tpt.element_func(function newfunction, number el_number)
    tpt.element_func(function newfunction, number el_number, boolean replace)
  • billion57
    24th Apr 2012 Member 0 Permalink

    boxmein:


    Now this here is a prime example for a bad help thread.
    [/quote]

    Hey!

    But wait, I made the autorun.lua, and it's not showing up in TPT! I tried MassacreLand's NUKE element.
  • mniip
    25th Apr 2012 Developer 0 Permalink
    Do you know how to run a script right?
  • billion57
    25th Apr 2012 Member 0 Permalink
    No...
  • jenn4
    25th Apr 2012 Member 0 Permalink
    Is the file in the same directory as your TPT?
  • billion57
    25th Apr 2012 Member 0 Permalink
    @jenn4 (View Post)
    If by directory you mean folder, then yes.
  • mniip
    26th Apr 2012 Developer 0 Permalink
    At first learn lua
    http://lua.org/pil
    pm me here or on irc if you get stuck
  • billion57
    26th Apr 2012 Member 0 Permalink
    Awww...