Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local partMax, delay = 8, 0.1
- local block = {"minecraft:wool", "minecraft:stained_glass", "minecraft:stained_glass_pane", "minecraft:stained_hardened_clay"}
- local holo = {peripheral.find("hologram_projector")}
- do
- local interfaces = {peripheral.find("universalInterface")}
- for i = 1, #interfaces do for _, side in pairs(rs.getSides()) do
- local thisPer = interfaces[i].wrapPeripheral(side)
- if thisPer.setVelocity then holo[#holo + 1] = thisPer end
- end end
- end
- if #holo == 0 then error("No projectors found.") end
- local particles = {}
- for i = 1, #holo do
- holo[i].clear("minecraft:air", 0)
- holo[i].setVelocity(1)
- particles[i] = {}
- for j = 1, partMax do particles[i][j] = {3.5, 0, 3.5, math.random() - 0.5, math.random(), math.random() - 0.5, block[math.random(#block)], math.random(16) - 1} end
- end
- while true do
- for i = 1, #holo do
- local thesePars = particles[i]
- local holoMap, marked = {}, {}
- for j = 1, #thesePars do
- local thisPar = thesePars[j]
- local PosMark = thisPar[1] .. thisPar[2] .. thisPar[3]
- if not marked[PosMark] then
- holoMap[#holoMap + 1] = {["x"] = thisPar[1], ["y"] = thisPar[2], ["z"] = thisPar[3], ["name"] = "minecraft:air"}
- marked[PosMark] = true
- end
- thisPar[1] = thisPar[1] + thisPar[4]
- thisPar[2] = thisPar[2] + thisPar[5]
- thisPar[3] = thisPar[3] + thisPar[6]
- if thisPar[1] < 0 or thisPar[1] >= 8 or thisPar[2] >= 8 or thisPar[3] < 0 or thisPar[3] >= 8 then
- thisPar = {3.5, 0, 3.5, math.random() - 0.5, math.random(), math.random() - 0.5, block[math.random(#block)], math.random(16) - 1}
- particles[i][j] = thisPar
- end
- holoMap[#holoMap + 1] = {["x"] = thisPar[1], ["y"] = thisPar[2], ["z"] = thisPar[3], ["name"] = thisPar[7], ["meta"] = thisPar[8]}
- marked[thisPar[1] .. thisPar[2] .. thisPar[3]] = true
- end
- holo[i].draw(holoMap)
- end
- sleep(delay)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement