From 2050ebc1d70b83f94243326540ef38344232fe21 Mon Sep 17 00:00:00 2001 From: olliy <55839810+olliy1or@users.noreply.github.com> Date: Thu, 22 Apr 2021 05:40:16 +0500 Subject: [PATCH] use HUD instead of sending a message --- shooter_rocket/init.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/shooter_rocket/init.lua b/shooter_rocket/init.lua index 3a74152..b29cc0a 100644 --- a/shooter_rocket/init.lua +++ b/shooter_rocket/init.lua @@ -82,7 +82,11 @@ minetest.register_tool("shooter_rocket:rocket_gun_loaded", { groups = {not_in_creative_inventory=1}, on_use = function(itemstack, user, pointed_thing) if plcooldown[user:get_player_name()] ~= 0 then - minetest.chat_send_player(user:get_player_name(), "Your rocket has a cooldown!") + hud_event.new(user:get_player_name(), { + name = "shooter_rocket:cooldown", + color = "0xC1FF44", + value = "Your rocket has a cooldown!" + }) else if not minetest.settings:get_bool("creative_mode") then itemstack:add_wear(65535 / 50)