Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local do_circle = function(pos)
- local size = 3
- local step = 4
- for i = 0, 360, step do
- local angle = (i * math.pi / 180)
- local x = size * math.cos(angle)
- local z = size * math.sin(angle)
- local newpos = {x = pos.x + x, y = pos.y, z = pos.z + z}
- minetest.add_particle({
- pos = newpos,
- velocity = {x = 0, y = 0, z = 0},
- acceleration = {x = 0, y = 0, z = 0},
- expirationtime = 0.25,
- collisiondetection = false,
- texture = "default_wood.png",
- size = 5,
- glow = 15,
- })
- end
- end
- minetest.register_node("test:block", {
- description = "Test Node",
- tiles = {"default_wood.png"},
- light_source = default.LIGHT_MAX,
- groups = {dig_immediate = 3},
- on_construct = function(pos)
- minetest.get_node_timer(pos):start(0.4) -- start timer
- end,
- on_timer = function(pos, elapsed)
- do_circle(pos)
- minetest.get_node_timer(pos):start(1.0) -- set timer to every 1 second
- end,
- -- unaffected by explosions
- on_blast = function() end,
- })
Advertisement
Add Comment
Please, Sign In to add comment