1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-22 17:18:39 +00:00

ObjectRef:set_armor_groups() and ObjectRef:set_properties() - works on players too!

This commit is contained in:
Perttu Ahola 2012-03-30 13:26:40 +03:00
parent 9e7ccedba4
commit 3241ad3ae8
6 changed files with 154 additions and 64 deletions

View file

@ -6,6 +6,22 @@
experimental = {}
experimental.player_visual_index = 0
function switch_player_visual()
for _, obj in pairs(minetest.env:get_objects_inside_radius({x=0,y=0,z=0}, 1000000)) do
if obj:get_player_name() then
if experimental.player_visual_index == 0 then
obj:set_properties({visual="upright_sprite"})
else
obj:set_properties({visual="cube"})
end
end
end
experimental.player_visual_index = (experimental.player_visual_index + 1) % 2
minetest.after(1.0, switch_player_visual)
end
minetest.after(1.0, switch_player_visual)
--[[
stepsound = -1
function test_sound()