Trying to make an LED, strange issue

  • DanielsRevenge
    21st Jul 2021 Member 0 Permalink

    So I have some code that detects if there is SPRK nearby and creates PHOT going in all directions. It's like PCLN but it turns itself off when the power is no more.

     

    However I want it to be consistent like PCLN. I tried using the following code

     

    tpt.set_property('flags', "FLAG_SKIPMOVE", x + cx, y + cy)

     

    and it said that flags is an invalid property.

     

    I tried again using the same code, but instead of "FLAG_SKIPMOVE" I put 0x2. Same issue.

     

    How do I fix this?

  • TPTSortaGuy
    28th Jul 2021 Member 0 Permalink

    You have to do VARIABLE_OF_ELEMENT.elements.flags, not tpt.set_property ("flags")

    Read this for more info:

    https://powdertoy.co.uk/Wiki/W/Lua_API:Elements.html#Constants