Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --How to use: Choose "LAY" element from "tools" category; put it in any free place; type the number of layers you want;
- --Type element name, element ctype, element life, tmp and tmp2 and using spaces, commas or etc to split them.
- --Example: [number of layers]:[3]; [Particle 1]:[CONV METL 0 15]; [Particle 2]:[CONV SPRK 0 14]
- --This will create subframe sparker.
- local layering = elements.allocate("ELEMENT", "LAY")
- elements.element(layering, elements.element(elements.DEFAULT_PT_DMND))
- elements.property(layering, "Name", "LAY")
- elements.property(layering, "Description", "Create layered elements. Use brush with size = 0")
- elements.property(layering, "Colour", 0x00AA00)
- elements.property(layering, "MenuSection", 13)
- debounce = false
- local function update (i,xn,yn,s,nt) if debounce == false then
- debounce = true
- x,y = xn,yn
- sim.partProperty(i,2,0)
- layers = tonumber(tpt.input("Count","Type the number of layers, from 1 to 5"))
- if type(layers) == "number" and layers>0 and layers<6 then
- for i = 1,layers,1 do
- particle = tpt.input("Particle "..i, "Enter: type, ctype, life, tmp, tmp2 with spaces")
- count = 1
- for type in string.gmatch(particle,"%w+") do
- if count == 1 then currentPart = sim.partCreate(-3, x, y, tpt.el[type].id) end
- if count == 2 then if type(tonumber(typed))=="nil" then sim.partProperty(currentPart, "ctype",tpt.el[typed].id)
- else sim.partProperty(currentPart, "ctype", typed) end end
- if count == 3 then sim.partProperty(currentPart, "life", type) end
- if count == 4 then sim.partProperty(currentPart, "tmp", type) end
- if count == 5 then sim.partProperty(currentPart, "tmp2", type) end
- count=count+1
- end
- end
- else tpt.log("Error","Wrong input") end
- sim.partKill(i)
- debounce = false
- end end
- elements.property(layering, "Update", update)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement