This code keeps giving me the error, please help me figure out why. Specifically the for loop is causing the error.
What line is the error on?
for sim.partProperty(i, sim.FIELD_TMP), 1, 10, -1 do
that line
heres what i want to do. i want so when SPRK is beside QMPR it adds +1 to tmp then a few seconds later sparks all elements around it as many times as the number of tmp, as long as it is not higher then 10 or lower then 1, like a transistor/capacitator kinda thing. because quantum computing allows you to save signals that are at 0.4 or 0.6 instead of 0 and 1. also yeah this element is kinda laggy. anyways ima read that guide. EDIT okay my code is this now:
To get around using sleep functions, you could use PROP_LIFE_DEC in element properties and that acts like a clock that drops by 1 every frame. Then you could set life to 100 for example and create a check for when life hits 0.
Also, here's a sample for loop from one of my scripts:
for range=1,sim.partProperty(i,sim.FIELD_TMP4) do
shift(i,range,direction)
end
ANOTHER ERROR - so i found a function online that lets me do for loops like in Python, so i finally have that sorted out, but now im getting this error - NUMBER EXPECTED, GOT NIL - for this line of code.
This is in your update function right? I'm not too sure what you are trying to do with that but there's already an i in the update function which is the index of the particle and reusing variables can have confusing results.
ooooh