Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local id = nil
- minetest.register_chatcommand("testps",{
- func = function(name, param)
- if id then
- minetest.delete_particlespawner(id)
- local answer = tostring(id) .. " removed"
- id = nil
- return true, answer
- end
- local player = minetest.get_player_by_name("singleplayer")
- if not player then
- return false, "no such player"
- end
- local look_dir = player:get_look_dir()
- local vel = {x=5*look_dir.x, y=5*look_dir.y, z=5*look_dir.z}
- local pos = player:get_pos()
- id = minetest.add_particlespawner({
- amount = 10,
- time = 0,
- minpos = pos,
- maxpos = pos,
- minvel = vel,
- maxvel = vel,
- minacc = {x=0,y=-9.,z=0},
- maxacc = {x=0,y=-9.,z=0},
- minexptime = 10,
- maxexptime = 10,
- minsize = 5,
- maxsize = 10,
- collisiondetection = true,
- collision_removal = false,
- --texture = "default_torch_animated.png",
- texture = "default_key.png",
- --[[
- animation = {
- type = "vertical_frames",
- aspect_w = 16, aspect_h = 16,
- length = 30.0
- },
- --]]
- --attached = player
- })
- return true, ""
- end})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement