I'm trying to make a mod, showing first white, then green text, but this mod works only sometimes:
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
minetest.register_craftitem("testiki:tul", {
description = "beret vesh",
inventory_image = "testiki.png",
on_use = function(itemstack, player, pointed_thing)
-- Takes one item from the stack
local tekst = itemstack:take_item()
local hud = player:hud_add({hud_elem_type = "text",position = {x=0.3,y=0.5},direction = 0,text = tostring(tekst),scale={x=100,y=100},number = 0xFFFFFF,alignment = {x=0,y=0},offset = {x=0,y=0},})
player:hud_change(hud,number,0x00FF00)
return itemstack
end,
})
How to make it always workable?