Add script to turn players into meshes, ticks every 1 second
[oweals/minetest_game.git] / mods / default / player.lua
1 -- Minetest 0.4 mod: player
2 -- See README.txt for licensing and other information.
3
4 -- The API documentation in here was moved into doc/lua_api.txt
5
6 -- Set mesh for all players
7 function switch_player_visual()
8         prop = {
9                 mesh="player.b3d",
10                 textures = {"player.png", },
11                 visual="mesh",
12                 visual_size={x=1, y=1},
13         }
14         for _, obj in pairs(minetest.get_connected_players()) do
15                 obj:set_properties(prop)
16         end
17         minetest.after(1.0, switch_player_visual)
18 end
19 minetest.after(1.0, switch_player_visual)
20
21 -- Definitions made by this mod that other mods can use too
22 default = {}
23
24 -- Load other files
25 dofile(minetest.get_modpath("default").."/mapgen.lua")
26 dofile(minetest.get_modpath("default").."/leafdecay.lua")
27
28 -- END