The update function's arguments are just i, x, y, s, and nt. What you're looking for is sim.partProperty.
sim.partProperty(i, property, value) sets the property of a particle, while sim.partProperty(i, property) gets it.
More info is here:
https://powdertoy.co.uk/Wiki/W/Lua_API:Simulation.html#simulation.partProperty
okay