Skip to content

Instantly share code, notes, and snippets.

@kaeza kaeza/init.lua Secret
Last active Apr 5, 2019

Embed
What would you like to do?
Minetest - Flash screen
minetest.register_craftitem("mymod:myitem", {
description = "Flash",
inventory_image = "default_wood.png",
on_use = function(itemstack, user, pointed_thing)
if not user:is_player() then return end
local plname = user:get_player_name()
local hud_id = user:hud_add({
hud_elem_type = "image",
position = {x=0, y=0},
text = "mymod_flash.png",
alignment = {x=1, y=1},
scale = {x=-100, y=-100},
})
-- Remove "flash" after one second.
minetest.after(1, function()
user:hud_remove(hud_id)
end)
user:set_hp(user:get_hp() + 4)
end,
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.