It seems that there is no need for new Lua code. Instead, the old one should just be fixed. Actually, I found this in lua_api.txt:
object:set_properties(object_properties_table)
Players are objects. The object properties table includes a field called “hp_max”. So I would expect that
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
sets the max HP to 5. But nothing happens. :/ If I have 1 HP, I can still heal myself up to full 20 HP.
I also noticed that
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
player:set_properties({makes_footstep_sound=false})
does not change anything.
is_visible=false does not work either. Yeah, it seems that some object properties can not be changed for players. Bug?
Actually, using a call like player:set_properties is not uncommon, it used serveral times in minetest_game/default/player.lua. But it is only used to set models and textures and stuff like that.